Scripting to Autoclean AO’s cache
-
Hello @optimizingmatters
I’m trying to write a snippet so I can autoclean AO’s cache if it gets over 100Mb but it doesn’t work getting easily over 300Mb because I chose to activate “aggregate inline JS” given the performance increase it has on my website.
- Could you help me improve the code below to make it work?
- Also I noticed when cache is below 100Mb server’s “Physical Memory Usage” is around 30% (300Mb/1Gb) and when the cache is 300Mb usage is 70% (700Mb/1Gb) what would be the ideal limit size of AO’s cache for an optimal Physical Memory Usage?
if (class_exists('autoptimizeCache')) { $myMaxSize = 1024000; # What value would be ideal for 1Gb physical mem? $statArr=autoptimizeCache::stats(); $cacheSize=round($statArr[1]/1024); if ($cacheSize>$myMaxSize){ autoptimizeCache::clearall(); header("Refresh:0"); # Refreshes page so AO can create new files. } }Thanks for your attention.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Scripting to Autoclean AO’s cache’ is closed to new replies.