{"id":4972,"date":"2009-09-15T05:37:13","date_gmt":"2009-09-15T09:37:13","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=4972"},"modified":"2009-09-15T05:37:13","modified_gmt":"2009-09-15T09:37:13","slug":"super-cache","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=4972","title":{"rendered":"Super Cache"},"content":{"rendered":"<p>I&#8217;m using a WordPress plugin called &#8220;super cache&#8221;.  Every few months I&#8217;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 &#8211; existing readers and visitors &#8211; 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&#8217;re reading now are generated on the fly.  It&#8217;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. <\/p>\n<p>Super Cache will pre-generate all pages for the site. Since installing it, I&#8217;ve absorbed a few decent hits from larger sites without going down.  <em>It works<\/em>.  Now, if you leave a comment anywhere on the site you&#8217;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&#8217;re viewing must be generated just for you.  <\/p>\n<p>But for everyone who hasn&#8217;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&#8217;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:<\/p>\n<div class=\"quote\">Hey, your theme switcher isn&#8217;t working.<\/p>\n<p>EDIT: Oops.  Looks like it&#8217;s working now.<\/p><\/div>\n<p>Of course, it&#8217;s &#8220;working&#8221; because they left a comment.<\/p>\n<p>Now, I can tun off super cache and have things work right.  I normally don&#8217;t need it.  But if I get hit, I do need it. And usually I don&#8217;t know about the problem until I&#8217;m already locked out by the mob and I can&#8217;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&#8217;s why things are sometimes wonky, in case you&#8217;ve ever wondered.<\/p>\n<p>Aside: Ever notice how WordPress blogs always say &#8220;Twenty Sided is proudly powered by WordPress&#8221; or &#8220;World of Wombats is proudly powered by WordPress&#8221;, etc. It makes it seem like WordPress doesn&#8217;t have any standards.  It would be much better if it could say, &#8220;World of White Supremacy is shamefully and begrudgingly powered by WordPress&#8221;.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using a WordPress plugin called &#8220;super cache&#8221;. Every few months I&#8217;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 &#8211; existing readers and visitors &#8211; is left out. Everyone loses. I eventually determined that it was (probably) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-4972","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/4972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4972"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/4972\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}