Copy/ pasted straight from a support question on wordpress.org;
Auto-deleting the cache would only solve one problem you’re having (disk space), but there are 2 other problems -which I consider more important- that auto-cleaning can never solve:
1. you will be generating new autoptimized JS very regularly, which slows your site down for users who happen to be the unlucky ones requesting that page
2. a visitor going from page X to page Y will very likely have to request a different autoptimized JS file for page Y instead of using the one from page X from cache, again slowing your site down
So I actually consider the cache-size warning like a canary in the coal mines; if the canary dies, you know there’s a bigger problem.
You don’t (or shouldn’t) really want me to take away the canary! 🙂
Thank You!!!
Finally I think I understand more about the “caftty-cascheing” in AO.
Your…. canary in the coal mine….allagory seems perfect to me!!
Thanks so much…from a longtime user!
Hi,
firt of all, thank you for providing autoptimize!
I don’t mind that ther cache grows big – however, the blinking red circle annoys my editor-in-chief 🙂
Is there any way to set the threshold where it starts to blink? e.g., 10 GB or whatever?
Thank you,
Hauke
sure, using the API;
add_filter('autoptimize_filter_cachecheck_maxsize','change_maxsize');
function change_maxsize() {
return 10*1024*1024;
}
Wow, that was one fast reply! 😉
Since I’m not really into wordpress-hacking – which of the many php scripts should this be placed in? Preferably something that does not get overwritten the next time I update either wp itself, your plugin or my theme – is there any such thing?
(And, here’s the feature request: how about making the sizeconfigurable in settings?)
Thx,
/hauke
I have too many settings already, don’t want to add to that, but easiest way to add the code is using the code snippets plugin. 🙂
Many thanks for this solution Frank.
Uh, that’s one great tip to use that code snippet thingie, thank you very much – works like a charme!
By the way, in order to achieve a 10 GB cache size you would have to set 10 * 1024 * 1024 * 1024 – you are using bytes, not kilobytes :).
I’m trying 1 GB, and for now that seems to be ok. In your opinion, is a cache size of ~750 MB too big? I know that it probably depends on roughly a milion factors – I’m just curious why it is as “big” as it is. So far it’s not really a problem, but I’m wondering: Is my canary about to die?
Thanks again,
/hauke
well, 750MB does mean you’ve got a lot of different JS-files, which means that (assuming you have on average half a MB per JS-file) at least 1500 visitors had to wait for the JS-file to be created. I would try to find a way for more reuse of the cached files if I were you.
PS: This is what I just got from my “editor in chief” after I applied your “fix”:
Jaaaaa, DANKE! ❤ :* :* (Yesssss, THANK YOU!)
So, now you know it was worth the time (at least for me 😉
Is there a way to modify the email so that my client does not get it but I do ? I am an admin on the account but this is a fortune company and their IT is the default admin unless a plugin has an alternate way to pick the admin for the email.
Thanks
you can use the
autoptimize_filter_cachecheck_mailto
filter Tom.Thank you very much for making this plugin available. Awesome work to make this free to everyone. Thank you
Hi, do you have any tips to locating what is causing the cache size increase, do you have logs.
It appears the CSS is generating every time I update refresh the site, which breaks other CDN’s I have in place.
Any points of where to look would help alot.
Try unticking the “also aggrate inline CSS”-option maybe Shaun?
Hi Frank,
Thank you for the response, that does seem to have resolved that, I assume it was Visual Composers rubbish being added to the page. that has made the side load 0.3 seconds faster as well.
Thank you