|Random||By Shamus||Sep 15, 2009||44 comments|
I’m using a WordPress plugin called “super cache”. Every few months I’ll get a link from a big site and the resulting crush of traffic that will flatten the site. Instead of me getting new readers, everyone – existing readers and visitors – is left out. Everyone loses. I eventually determined that it was (probably) a CPU problem, not a bandwidth one. (I can post some huge image that will increase my bandwidth usage for the day by a factor of three with no ill effects. But triple traffic can bring the cite to a crawl.) PHP pages like the one you’re reading now are generated on the fly. It’s cool like that. Except, it can take time to produce. WordPress eats a good bit of CPU, and then my dice rollers and sidebar shuffler add to that.
Super Cache will pre-generate all pages for the site. Since installing it, I’ve absorbed a few decent hits from larger sites without going down. It works. Now, if you leave a comment anywhere on the site you’ll be exempt from Super Cache because your page must be generated: Note how the comments form remembers your name and such. In order to have it do that, the page you’re viewing must be generated just for you.
But for everyone who hasn’t commented, they all view a single common page. Problem: My theme selector. Whoever views a page first will set the page for everyone else. If they’re using the evil theme, then all non-commenting visitors will see the page in black for a while. This explains why I often see comments from people:
EDIT: Oops. Looks like it’s working now.
Of course, it’s “working” because they left a comment.
Now, I can tun off super cache and have things work right. I normally don’t need it. But if I get hit, I do need it. And usually I don’t know about the problem until I’m already locked out by the mob and I can’t get in to turn it on. Still, it seems to make more sense to design the site to work properly in most cases, instead of designing it to malfunction all the time so that it can stay up in a rush. Hmm. Anyway, that’s why things are sometimes wonky, in case you’ve ever wondered.
Aside: Ever notice how WordPress blogs always say “Twenty Sided is proudly powered by WordPress” or “World of Wombats is proudly powered by WordPress”, etc. It makes it seem like WordPress doesn’t have any standards. It would be much better if it could say, “World of White Supremacy is shamefully and begrudgingly powered by WordPress”.