no, that’s not possible; AO combines all JS & CSS and checks if that is in the cache already. if it would not be able (allowed) to save new files to cache, it would not know what to use instead.
if your worries are concerning the amount of files in cache; make sure “also aggregate inline JS” and “also aggregate inline CSS” are off, this will significantly lower the problems with cache size.
hope this helps,
frank
Thread Starter
Fropky
(@fropki)
frank,
my concern is related to http 2 push for CSS/js file. These file name change too frequently. I can not choose a file name and can’t write http header for ever changing js/css file name.
So I was thinking can it be manually generated.
-
This reply was modified 2 years, 6 months ago by
Fropky.
Thread Starter
Fropky
(@fropki)
I tried this method. But I dont think it is doing anything
function pushAOFiles($in) {
$pushType = substr($in,strrpos($in,".")+1) === "js" ? "script" : "style";
header('Link: <'.$in.'>; rel=preload; as='.$pushType,false);
return $in;
}
add_filter('autoptimize_filter_cache_getname','pushAOFiles');
Thread Starter
Fropky
(@fropki)
Thank you for solving my issue.
-
This reply was modified 2 years, 6 months ago by
Fropky.
so it does work now fropki ?
Thread Starter
Fropky
(@fropki)
I dont know its working or not but header is set in right way. Need to test more if it is working or not especially with defer in javascript.
OK, let me know if you have any further questions re. AO π
and feel free to leave a review of the plugin and support here! π