Cache files being deleted
-
Hi,
I’ve used this plugin on several sites now but something strange is happening on one with Woo.
I run the preload and it all seems to work.
Look in the page cache page and I can see nn Mb of Cache and nn pages cached.
Check in /wp-content/cache/wpo-cache/ and I can see all the relevant pages/products etc files…So all good.
Then for some bizarre reason the cache is purged and all the files have gone.
Plus if visiting pages as a “logged” in user the pages are not created.
If log out then visit pages, then they are then cached.
Is it supposed to load pages into cache if you are logged in or not?
I guess not.I do have cache pages to logged on user set. Is it something to do with this.
Theme being used is a non child implementation of Avada.Thanks,
Chris
-
Hi Chris,
> Then for some bizarre reason the cache is purged and all the files have gone.
Have you edited your site in between? See the reasons that cause
the cache to be purged: https://getwpo.com/faqs/when-does-wpo-clear-the-cache/> Plus if visiting pages as a “logged” in user the pages are not created.
The cache isn’t created to avoid caching user related content. So it’s only created when visiting anonymously and preloading.
> I do have cache pages to logged on user set
This will serve the cache if it exists, but not create it for the reason mentioned above.
Marc.
Hi Marc,
Thanks for the quick response.
Yes, there were edits. Not directly a menu, but adding a new product.
So would this constitute a menu change and therefore a full purge then?
The other functions are not relevant in this case.Thanks for the other explanations. They make sense.
Thanks,
ChrisOk, further to my last email I’ve reproduced it.
All caching files were in their file directory.
Happily browsing around the site and all good.When I logged in to the admin this then triggered the flush/purge of the cache.
It was the only action performed. No-one else was logged on.Thoughts?
Chris
That’s odd. Do you have any other plugin that might be using the cache folder? (
/wp-content/cache/
is a folder common to most caching plugins).Not that I can think of. The advanced-cache.php dropin is yours, right?
I can give you a list if plugins but there aren’t many and none spring to mind as cache related.
The Theme has some performance options in Avada. But this is around JS & CSS and their cache is under /uploads/fusion-styles and /uploads/fusion-scripts.
When the site was on test/dev before moving to live it was using Litespeed. That was then removed and then your plugin installed.Update: Now I’m aware of the problem I see it happening on another site as well.
This doesn’t have Woo installed. Same config etc.
I know 100% this site has not been updated in terms of pages, menus etc.
As the client gets us to perform this.
I’ll check the other sites we use now as well.
I suspect maybe now it’s not unique. Checked a 3rd site and that one is ok.
Is there some sort of debugging we can put on to see what/why the cache is being totally purged?Hi Chris,
Sorry for the delay. WP-Optimize doesn’t have any trigger to clear the cache when logging in. Only the specific actions in the link I provided earlier do that.
So this suggests that something else is doing it. Maybe a plugin, theme, or your hosting deletes the
wp-content/cache
directory.You could try overriding the cache location by adding
define('WPO_CACHE_FILES_DIR', ABSPATH.'uploads/wpo-cache');
at the bottom of wp-config.php (afterdefine( 'ABSPATH', dirname( __FILE__ ) . '/' );
).(You’ll have to clear the cache then save the cache settings for it to take effect.)
Marc.
Hi Marc,
Thanks for the reply. I don’t think it is now directly related to logging in. It just all disappears after around 10 mins.
I wonder if it’s something on our VPS then, such as AV. But I remember excluding the WPO directory as it did flag it up in the scans.
Likewise I’ll add it to an ignore list in the security plugin as it’s comes up as files changed warning.
I guess if it was hosting then all instances of the plugin cache would be deleted. So I don’t think it is this. I have another site which also has files deleted but then again another one which doesn’t.
I’ll amend the above and move it and see what difference that makes.
Thanks,
ChrisHi Marc,
So it is now moved to the uploads directory and within 30 mins is purged again.
I have 10 sites with the plugin. On 8 of them I don’t see this behaviour. But on two of them I do.
Thanks,
ChrisHi Chris,
I’m in the same boat – flush get’s triggered somewhere every 5 to 10min …
I’ve tried to add a hook, which writes something in a logfile, when the action
log_cache_flush
get’s called, but the hook get’s never called, so there is something else that deletes the directory.I’m still investigating the issue,
but will now try to change the cache directory as suggest by Marcnope… didn’t help either.Did you find something else in the meanwhile?
Thanks,
Mathias-
This reply was modified 5 years, 1 month ago by
mrohnstock. Reason: tried Marc's suggestion
Hi Mathias,
I honestly cannot fathom out why it’s doing this. I wonder if it’s the theme that is doing this as I have CSS compiled, JS compiled and the themes own cache. Am thinking to turn this off and retest. But weird thing is I have other sites with same setup and they don’t show the same symptoms. I think Marc is right in that it is something else as I put in W3 Total Cache and it then had exactly the same issues.
Chris
Hi there,
If you’re comfortable with a bit of code, you can add the following to a plugin or functions.php. Ideal would be in a mu-plugin, as they get loaded first.
add_action('wpo_cache_flush', function() { error_log(print_r(debug_backtrace(), true)); });
This will write the list of functions called to get to the cache flush in the error log. You can then share it here (probably via pastebin or something similar).
For a simpler result you can also just add
error_log(print_r(debug_backtrace(), true));
tofunction wpo_cache_flush() {
inplugins/wp-optimize/cache/file-based-page-cache-functions.php
L.504.(You might not want to keep this in for too long, as debug_backtrace outputs quite a bit of data).
If this doesn’t show anything, you might want to share the list of active plugins, theme, and maybe hosting. As you both have the same issue, we might see what’s common between you.
Marc.
Hi Marc,
For now, I’ve turned off all the Avada theme performance options. If this has no result on the purging I’ll then look to implement one of the 2 above results. Thanks for your support.
Thanks,
ChrisHi Marc,
I got something simular active, only on manual flushing the cache through the webinterface of wp-optimize something get’s logged – so wp-optimize does not remove the cache.
I’ve the following plugins activated:
– AffiliateWP v2.4.3 by Sandhills Development, LLC
– Classic Editor v1.5 by WordPress Contributors
– Contact Form 7 v5.1.6 by Takayuki Miyoshi
– Germanized for WooCommerce v3.1.2 by Vendidero
– Germanized for WooCommerce Pro v2.0.11 by Vendidero
– Klarna Order Management for WooCommerce v1.5.0 by klarna, krokedil
– Klarna Payments for WooCommerce v2.0.5 by krokedil, klarna, automattic
– MetaSlider v3.15.3 by Team Updraft
– PixelYourSite v7.1.4 by PixelYourSite
– PixelYourSite Pinterest v2.0.9 by PixelYourSite
– Redirection v4.6.2 by John Godley
– Site Reviews v4.3.3 by Paul Ryley
– Smush v3.4.2 by WPMU DEV
– Sofort payment gateway v1.4.4 by Sven Wagener
– Storefront Mega Menus v1.6.2 by WooCommerce
– Storefront Powerpack v1.5.0 by WooCommerce
– User Role Editor v4.52.2 by Vladimir Garagulya
– Vendidero Helper v1.3.0 by Vendidero
– WC Variations Radio Buttons v2.0.2 by 8manos
– WooCommerce v3.8.1 by Automattic
– WooCommerce Admin v0.24.0 by WooCommerce
– WooCommerce Amazon Pay v1.11.0 by WooCommerce
– WooCommerce Multilingual v4.7.7 by OnTheGoSystems
– WooCommerce PayPal Checkout Gateway v1.6.18 by WooCommerce
– WooCommerce Smart Reminder Emails v1.4.2 by Ewout Fernhout
– WooCommerce Stripe Gateway v4.3.1 by WooCommerce
– WP-Optimize – Clean, Compress, Cache v3.0.15 by David Anderson, Ruhani Rabin, Team Updraft
– WP Desk Helper v1.7.0 by WP Desk
– WP Mail SMTP v1.8.1 by WPForms
– WPML Media v2.5.5 by OnTheGoSystems
– WPML Multilingual CMS v4.3.6 by OnTheGoSystems
– WPML String Translation v3.0.6 by OnTheGoSystems
– WPML Translation Management v2.9.4 by OnTheGoSystems
– Yoast SEO Premium v12.5 by Team YoastMy active theme is Storefront v2.5.3 by Automattic
oh, missed one point: We’ve a root server and did installed / configure everything by our own.
-
This reply was modified 5 years, 1 month ago by
mrohnstock. Reason: missed one point
Hi,
Update for you.
The theme options for performance I mentioned had little to no effect as the cache was deleted/purged again when I checked 1st thing this morning.What is strange also is that I have iThemes security plugin installed. It logs file changes/deletions/adding. So when I cleared out and turned off the fusion cache in avada this was all logged. As was the adding of the cache files by wpo.
The removal of the cache however wasn’t logged.The only plugins that are shared with mrohnstock are:
Contact Form 7 v5.1.6
WooCommerce v3.9.1
WooCommerce Admin v0.24.0
Yoast SEO v12.9.1Theme is completely different, mine being Avada.
Next step then is to try the logging.
Our host is our own VPS. I don’t know what would cause this behaviour as it’s nothing unusual. And as mentioned before we have 10 sites with WPO.
It does seem to be linked with the more active sites in terms of content being changed.
Chris
Thanks,
Chris -
This reply was modified 5 years, 1 month ago by
- The topic ‘Cache files being deleted’ is closed to new replies.