Cache setting not being honored
-
Using WordPress 5.2.2, WP Super Cache version 1.6.9.
Cache setting worked fine until recent update to version 1.6.9. Using “Expert” mode.
I clicked on “Changed Expiration”, but made no changes to the settings – no change in the problem.
The page I need help with: [log in to see the link]
-
Can you enable the debug log and then try to change settings. The log may tell you of any problems it finds.
Did that; enabled log, made a change, viewed log – but not sure what I’m looking for. I do not see anything like “error”.
Just updated to Version 1.7.0
I cannot view the debug log. When I click on the log file link it takes me to a 404 Page Not Found.
Using “Expert Mode”
Since I got a 404, I deleted WP Super Cache, removed any reference in the htaccess file, and reinstalled, using Easy Mode for now. Will see what happens.
Reinstalling made no change with my original post. Current using Simple mode.
The index.php file is being cached when there is a page hit rather than “Expiry Time” setting.
Setting for “Add here those filenames that can be cached, even if they match one of the rejected substring specified above.” I entered index.php in this box (field) and no help.
How can the index.php, or more specifically, the home page be cached and honor the settings in WP Super Cache?
Going to the home page WPSC creates a cached file, within an hour that page is removed, but other pages remain and honor expire time. Expire time set to 86400 (24 hours).
“How long should cached pages remain fresh? Set to 0 to disable garbage collection. A good starting point is 3600 seconds.” Tried setting to 0 (Zero) but saving it reverts to 3600 – will not accept zero, so I cannot disable garbage collection.
How, or what, is causing the cached home page (index-https.html) to expire before garbage collection set time?
> The index.php file is being cached when there is a page hit rather than “Expiry Time” setting.
That’s fine. A file is generated when a visitor comes to the site. The expiry time means the garbage collection will delete (or rebuild) files older than the time.
> How, or what, is causing the cached home page (index-https.html) to expire before garbage collection set time?
If you enable the debug log, and it works for you this time, then that should tell you what’s creating the homepage or what is deleting it. Could be a comment being left, or another plugin on your site even.
You’re missing my point; home page is cached when a visit is made, so the next time someone comes to the home page should get the cached HTML page if visited before the expire time, not create a NEW cached page. The expire date was set to 24 hours (86400 seconds).
Changed expire time to 604800 seconds (1 week), no change in problem.
The debug file has lots of stuff – have no idea what I supposed to look for, for index.html being deleted BEFORE the expire time.
-
This reply was modified 5 years, 7 months ago by
q120000.
In the debug log look for “wp-content/cache/supercache/[HOSTNAME]/index” and you will probably find the line that deletes the homepage cache. Scroll back up and it will tell you what caused that delete, I hope.
OK, the debug file has lots of stuff, with lots of wp-cron.
Below is an excerpt from the debug file (not sure if this is what I should be looking at):
18:10:32 57601 /wp-cron.php?doing_wp_cron=1566324606.2411739826202392578125 prune_super_cache: exiting as file/directory does not exist : ABSPATH/wp-content/cache/supercache/xxxxx.net/page/ 18:10:32 57601 /wp-cron.php?doing_wp_cron=1566324606.2411739826202392578125 Post change: supercache enabled: deleting cache files in ABSPATH/wp-content/cache/supercache/xxxxx.net/ 18:10:32 57601 /wp-cron.php?doing_wp_cron=1566324606.2411739826202392578125 wpsc_delete_files: deleting ABSPATH/wp-content/cache/supercache/xxxxx.net/
It appears to me that wp-cron is deleting (I assume) the HTML files for the home page, but all the other cached files remain. For instance:
18:10:32 57601 /wp-cron.php?doing_wp_cron=1566324606.2411739826202392578125 wpsc_delete_files: reading files: quotes
So the page “quotes” was not deleted.
And, there have not been any additions to the home page. But even if there were, wouldn’t WPSC create a NEW cached file and reset the expire time for that (home) page?
I have thus far only mentioned this one website, I have same issue with my other sites. Of all the sites, they do not have the same compliment of plugins and themes.
My frustration is basically the issue that most visitors will come to the home page first, and be welcomed with a SLOW page load, thereafter the page loads are quick because the other pages are still cached.
As a side note: It might be nice to have an export/import feature of settings for WPSC so those that have multiple websites (especially on the same server) can easily replicate on the other sites. But also, to easily export the settings for help in this support forum so others can quickly see and evaluate and offer a more informed reply.
-
This reply was modified 5 years, 7 months ago by
q120000.
Unfortunately I don’t know why your homepage is being deleted, but an export feature for the settings would be good. I know not everyone will know how to copy the wp-content/wp-cache-config.php file as it might not be readable by the user.
I never figured out “exactly” what was causing the problem, however, it’s now working.
My theme and a plugin were old and no longer supported and they would not operate with any PHP above 5.36. I changed the theme and deleted the old plugin. Then upgraded to PHP 7.3.7, then WPSC started working.
So, I’m not sure if it was upgrading to the latest PHP version, changing the theme, or deleted the old plugin – or a combination of any of those.
In any case, running the latest PHP version my website runs faster.
-
This reply was modified 5 years, 7 months ago by
- The topic ‘Cache setting not being honored’ is closed to new replies.