{"id":4760,"date":"2008-11-18T23:44:30","date_gmt":"2008-11-18T18:14:30","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=4760"},"modified":"2020-05-24T10:05:18","modified_gmt":"2020-05-24T04:35:18","slug":"wp-super-cache-not-deleting-expired-pages","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2008\/11\/wp-super-cache-not-deleting-expired-pages\/","title":{"rendered":"WP Super-Cache Not Deleting Expired Pages"},"content":{"rendered":"<p>I recently tweaked our blog template and was surprised to see a large number of pages <em>were still displaying the old template!<\/em> Obviously these pages were being displayed by WP Super-cache, but I had already deleted the wordpress cache, <em>so how was it possible?<\/em><\/p>\n<p>I was using the latest version of WP-super-cache 0.8.4 (like most wordpress users), a superb <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/06\/most-essential-wordpress-plugins\/\">must-have plugin<\/a> that provides a very fast caching module for WordPress, which means your site can easily survive a Digg on a shared server. When I checked the Supercache admin panel, it showed the <strong>counter stuck at 1183 expired files<\/strong> in supercache, and it would not change whatever you do.<\/p>\n<h3>WP-Supercache Not Deleting Expired Pages<\/h3>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-4761\" title=\"Supercache Expired Pages\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/supercache-expired.gif\" alt=\"\" width=\"182\" height=\"179\" \/><\/p>\n<p>After repeated attempts I simply could <strong>not delete the Super cache expired files<\/strong> \u2013 I tried turning the plugin on and off, tried to turn it half on (WP-cache only, Supercache disabled), supercache compression on and off, delete cache button, delete expired button\u2026 but nothing helped.<\/p>\n<p>The first time I had <strong>installed WP-supercache<\/strong> a few months back, it was <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/05\/fix-wp-super-cache-errors\/\">not caching pages<\/a>, but I fixed the issue. This time however the problem refused to get fixed. I simply could not let 1183 frequently visited pages on the site show outdated pages with an older template.<\/p>\n<h3>Switch to Older Version of WP-Supercache<\/h3>\n<p>I realized the problem had occurred since I installed the latest version of WP-supercache recently by plugin autoupgrade. The changelog revealed some change was recently made to garbage collection timing. Someone suggested I try the WP Super Cache Cleaner WordPress plugin that will periodically delete expired super-cache files regardless of whether your blog has reached the X requests threshold. However, only expired super-cached files will be deleted and WP-Cache files wont be affected.<\/p>\n<p>Since it would take time before <a href=\"https:\/\/wordpress.org\/support\/topic\/plugin-wp-super-cache-wp-super-cache-pages-not-deleting\/\" rel=\"noopener\">more users reported<\/a> the issue, a bug was identified, and a new version released, I decided to switch back to the previous version. <em>But where could I find the previous version of WP-supercache?<\/em><\/p>\n<p>Fortunately wordpress plugin headquarters <strong>archive all older plugin versions<\/strong>. I found the older version of WP-Super-cache (0.8.3) there and downloaded it. Then after backing up my current WP-supercache folder from the server, I uploaded the older version. Then I reactivated the plugin, pressed delete cache and\u2026 Expired pages = 0<\/p>\n<h3>More Supercache Experiments<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>UPDATE: <\/strong><\/span> WP-super-cache stopped working again after switching back to an older version. Till then manually deleting the cache seemed to be the reasonable option to keep the site going. I then switched back to the latest version. And here is how I proceeded further.<\/p>\n<p>Under wp-content\/cache\/supercache\/ there were hundreds of folders. I deleted all of them, but some folders refused to get deleted and had strange <strong>triple backslashes.<\/strong><\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-4786\" title=\"directory not empty\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/directory-empty.gif\" alt=\"directory not empty\" width=\"463\" height=\"96\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/directory-empty.gif 463w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/directory-empty-300x62.gif 300w\" sizes=\"(max-width: 463px) 100vw, 463px\" \/><\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-4783\" title=\"Undeleted folders\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/undeleted-folders.gif\" alt=\"Undeleted folders\" width=\"468\" height=\"60\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/undeleted-folders.gif 468w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/undeleted-folders-300x38.gif 300w\" sizes=\"(max-width: 468px) 100vw, 468px\" \/><\/p>\n<p>I figured maybe these folders were causing the cache to get stuck. Since these <strong>folders were undeletable<\/strong> via my FTP client Filezilla, I had to login via Shell using <a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/\" rel=\"noopener\">puTTY<\/a> and delete these folders. Once the Supercache folder was empty, I tried to deactivate and reactivate. Still not working.<\/p>\n<p>Now based on my <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/05\/fix-wp-super-cache-errors\/\">previous experiences<\/a> I <strong>deleted advanced-cache.php<\/strong> link in wp-content. Then I temporarily gave 777 priveleges to wp-content, again deactivated and reactivated the plugin, a new advanced-cache.php was created automatically, switched back wp-content to 755 and behold \u2013 the caching started as normal.<\/p>\n<p>This is my personal experience, I am no professional expert in this, try it at <span style=\"text-decoration: underline;\">your own risk<\/span>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently tweaked our blog template and was surprised to see a large number of pages were still displaying the&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-4760","post","type-post","status-publish","format-standard","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/4760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=4760"}],"version-history":[{"count":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/4760\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=4760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=4760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=4760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}