• Resolved Fropky

    (@fropki)


    Hi,

    Is there any way to disable auto generation of css js file and only generate when it done manually?

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    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 5 years, 1 month ago by Fropky.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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 5 years, 1 month ago by Fropky.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    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! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable auto generation of css js file’ is closed to new replies.