• Resolved Fadookie

    (@fadookie)


    Can I use WordPress to generate pages of static HTML? I ask because I volunteer as the webmaster for a nonprofit organization, and I recently installed wordpress to allow them to start a blog. I then moved the entire website over to wordpress in an attempt to make it easier for the organizers to manage the rest of the site by using WordPress pages.

    However, since it’s on a shared server, the shared database server occasionally gets hosed. This causes the entire website to go offline, which is very very bad.

    As a temporary fix, I downloaded all of the pages, cleaned them up a bit (I transcluded the navigation via SSI), and posted them as static HTML. This way, even if the database goes down, most of the site is still accessible.

    However, this has of course created problems with updating the site. I’d like to keep having them use WordPress as a backend because it’s easy and keeps the code clean, but in order to do that I need to figure out a way to get WordPress to generate the static HTML pages. I can’t do it manually every time.

    Does anyone know of a plugin or other hack that does this?

    If it was hosted on one of my servers, I’d probably hack together a cron job that occasionally ‘refreshes’ the static pages via wget, but they have a hosting plan without shell access.

    I really hope there’s some way to do this. I put a lot of work into the WordPress template and it would be a shame to have to move them to another CMS. I also don’t really like the prospect of them updating the static site with a WYSIWYG editor, as this tends to produce messy results. There goes my W3C Valid badge…

    Anyway, if anyone has any advice or general wisdom on the subject, please send it my way.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Instead of using static HTML, use a caching plugin like WP-Cache. This generates static content for your pages to improve speed of response and such.

    Thread Starter Fadookie

    (@fadookie)

    Thanks, WP-Cache looks like good news. I will check it out.

    Does it work even in the event that WordPress can’t connect to the database?

    Does it work even in the event that WordPress can’t connect to the database?

    I’d say no, but I don’t know for sure.

    What I *do* know is that you need to get a more reliable hosting service – one that doesn’t “hose” you on a regular basis. That’s a load of crap – if you’re paying for it, it should be reliable at the very least.

    Thread Starter Fadookie

    (@fadookie)

    I agree. If it were up to me, I’d move the site to Nearlyfreespeech.net, or even a box wired up at home. Right now we’re using one of the lower-end plans from Verio, I think it’s a shared FreeBSD box or something.

    I just installed WP-Cache (and took the opportunity to upgrade from 2.0.6 to 2.1.1). This seems good, however I’m looking for the most rock-solid configuration I can possibly get. Is there a way, for instance, to ensure that cached pages will be served even if WP can’t connect to the database? Even if the cached page has expired, it’s better than serving an error.

    As it stands, I’ve got about a week to come up with the most stable solution possible and convince them to stay with a WordPress backend for the site. Thanks for the help so far, any further assistance would be greatly appreciated.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Does it work even in the event that WordPress can’t connect to the database?

    Actually, yes, I believe it will. If the page being requested is cached by WP-Cache, it’s served directly from the cache and the script exits without ever attempting to connect to the database.

    Thread Starter Fadookie

    (@fadookie)

    Sounds good. My only remaining concern is that in the event of a database failure that concurs with a cache expiration, the site will become inacessible.

    I just set up a trial account with Nearlyfreespeech.net and registered my own dedicated MySQL process so hopefully this will be less of a problem if I can convince the management to switch hosting providers.

    Agh – Verio. I had a client who used Verio fir their WordPress site as well. It was a HUGE pain in the @**.

    Otto knows what he’s talking about, so I’d definitely trust what he’s saying. But I’m keeping my fingers crossed for you that they come to their senses and get a good host! (There’s some *good* ones out there – bluehost, asmallorange – those are just two great ones I’ve worked with to start on.)

    Thread Starter Fadookie

    (@fadookie)

    Yeah, tell me about it. ??

    At least they have a web interface for unzipping tarballs or else I would have had to upload wordpress file-by file. Uugh.

    Nearlyfreespeech.net seems to be working fine so far, but I ran into an issue when trying to activate WP-Cache because they have their PHP running in safe_mode. I guess there is a way to configure it so that the cache works in safe mode but I couldn’t find any info.

    However, I did find a thread about a WordPress internal cache that only works when safe_mode is on.

    I’ll fiddle with this later when I get a chance, but if anyone knows of any relevant documentation/resolved support requests on either of these (I saw a codex article but it seems pretty brief) please point me to them. Much appreciated.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The internal cache is not what you think it is. You probably don’t want to fiddle around with it.

    Thread Starter Fadookie

    (@fadookie)

    Hm, allright. I’ll take your word for it.

    This ticket seems to imply that cache can be made to work under safe-mode with the right configuration, but the more I learn about safe_mode, the more I think this isn’t possible on my current setup (and now I’m not sure if they mean WP-Cache or the internal one.)

    I’ll talk to the Nearlyfreespeech guys about disabling safe_mode and do what’s described here instead, but my guess is that they will be reticent to make such a sweeping change without more information.

    In the meantime I’ll check out some of the other hosts mentioned previously.

    “However, since it’s on a shared server, the shared database server occasionally gets hosed.”

    What?

    Get a professional service provider.

    If you want rock-solid, secure, dependable service, then perhaps you should pay for it?

    That’s the thing, Lost. Verio charges for their hosting service. It’s very sad.

    Thread Starter Fadookie

    (@fadookie)

    Yeah. As I said before I don’t have direct control over the hosting provider, Verio is definitely not my first choice.

    I did manage to get WP-Cache working under php safe_mode on my NearlyFreeSpeech.net site by changing the group of all files to web. I’m going to discuss this with the organization and see if they will consider changing hosts.

    Thanks for the help so far. If anyone has further advice on how to make WordPress as stable and reliable as possible, please enlighten me.

    (I’m considering setting the expiry time for pages to be quite long- months-, and having the updater just delete the cached file via the web interface when the page needs to be updated.)

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Generating a static site with WP’ is closed to new replies.