{"id":44,"date":"2008-01-18T11:42:46","date_gmt":"2008-01-18T18:42:46","guid":{"rendered":"http:\/\/codefork.com\/blog\/index.php\/2008\/01\/18\/caching-is-a-workaround-not-a-solution\/"},"modified":"2008-01-18T11:42:46","modified_gmt":"2008-01-18T18:42:46","slug":"caching-is-a-workaround-not-a-solution","status":"publish","type":"post","link":"https:\/\/codefork.com\/blog\/index.php\/2008\/01\/18\/caching-is-a-workaround-not-a-solution\/","title":{"rendered":"Caching is a Workaround, not a Solution"},"content":{"rendered":"<p>Like every website that deals with traffic spikes, the one I&#8217;m working on these days does a lot of caching. This past week I&#8217;ve spent a lot of time reviewing the caching code as well as tuning the database, to get the site working efficiently on a newly upgraded virtual private server.<\/p>\n<p>The following occurred to me: as wonderful and necessary as caching is, it&#8217;s fundamentally a workaround. The core problem is having insufficient resources. Given enough CPU and memory, you wouldn&#8217;t ever need to cache. It&#8217;s when those resources are insufficient for a particular traffic load that caching becomes immensely helpful. That&#8217;s why it&#8217;s a workaround: it practically addresses the problem, but it doesn&#8217;t really solve it. And it&#8217;s not a perfect solution: simple caching mechanisms usually introduce a lag time in the currency of content.<\/p>\n<p>Why does this matter? Because caching shouldn&#8217;t substitute for efficient code. That is, uncached operations should still try to make the best use of resources as possible. Otherwise, caching turns into a panacea, luring you into a false sense of security about how well the guts of the application really perform. Ideally, caching should always be added as an afterthought on top of already well abstracted code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like every website that deals with traffic spikes, the one I&#8217;m working on these days does a lot of caching. This past week I&#8217;ve spent a lot of time reviewing the caching code as well as tuning the database, to get the site working efficiently on a newly upgraded virtual private server. The following occurred &hellip; <a href=\"https:\/\/codefork.com\/blog\/index.php\/2008\/01\/18\/caching-is-a-workaround-not-a-solution\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Caching is a Workaround, not a Solution&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":0,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"wp:attachment":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}