• Resolved richardmorse441

    (@richardmorse441)


    Hello Support Team,

    Hope you’re doing well.

    I was checking my website’s performance using Google PageSpeed tool. I found that the tool is showing this error: Avoid enormous network payloads – Total size was 6,552 KiB. When I clicked on it, it’s showing many Autoptimize CSS files of 99.6 KiB size and if you open them you will see the exact same content.

    Due to this issue, webpage size has increased dramatically and it’s affecting the overall score as well.

    Kindly guide me to resolve this issue. Your support is highly appreciated. Thank you.

    Regards,
    Richard

    The page I need help with: [log in to see the link]

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

    (@optimizingmatters)

    something (Cloudflare/ WP Cloudflare Super Cache ?) is adding HTTP/2 push headers which link to autoptimized CSS files that are not really in use, can you try finding/ disabling that HTTP/2 function in CF/ WPCFSC?

    frank

    Hi @optimizingmatters,
    WP Cloudflare Super Page cache does not add any HTTP/2 push headers. If you want to use the HTTP/2 Server push then you need to write custom code to add the appropriate link headers and inside the “Fallback Cache” section you need to enable the option of “Save response headers”.

    But again the plugin does not do any HTTP/2 Server push by default.

    The official Cloudflare plugin does have a option to add list of items that you want to do server push. But as you know HTTP/2 server push is not always a very reliable option and in most cases it will slow down your site than making it faster I never recommend anyone using it.

    Inside WP Cloudflare Super Page cache if you want to do HTTP/2 Server Push this is how you need to do it: https://ww.wp.xz.cn/support/topic/the-best-cloudflare-plugin/#post-12949654
    As it does not add any server push link headers on it’s own.

    • This reply was modified 4 years, 6 months ago by iSaumya.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, the only thing that is sure is that *something* is doing HTTP/2 and that *something* is doing it wrong, pushing resources that are not referenced (and not needed/ used) in the HTML, bloating total transfer size considerably .. :-/

    Hi @optimizingmatters,
    Fully agree with you. Something is definitely doing that.

    Thread Starter richardmorse441

    (@richardmorse441)

    Hello @optimizingmatters and @isaumya,

    Thanks for replying.

    I found this code in my functions.php file:

    
    // futta autoptimize
    function pushAOFiles($in) {
      $pushType = substr($in,strrpos($in,".")+1) === "js" ? "script" : "style";
      header('Link: <'.$in.'>; rel=preload; as='.$pushType,false);
      return $in;
    }
    function pushJQuery($in) {
    	if (strpos($in,"js/jquery/jquery.js")!==false) {
    	  	$jQurl=includes_url("js/jquery/jquery.js");
    	    header('link: <'.$jQurl.'>; rel=preload; as=script',false);
    	}
    }
    //add_filter('autoptimize_filter_js_exclude','pushJQuery');
    add_filter('autoptimize_filter_cache_getname','pushAOFiles');
    add_filter('autoptimize_filter_cache_create_static_gzip','__return_true');
    

    Is this what we are looking at? Please let me know. If this is not what we are looking for then please guide me a bit to find the code. What should I search for?

    Thank you.

    Hi @richardmorse441,
    Yes that is exactly what’s adding that. Try removing that code from your site and the HTTP/2 push issue should be resolved.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    I +1 on what Saumya wrote! πŸ™‚

    Thread Starter richardmorse441

    (@richardmorse441)

    Thanks a lot, Saumya. Now, this issue has been resolved..

    But the strange thing that happened is after resolving this issue Google Page Speed score decreased πŸ™ Earlier for Desktop, it was 92 or 93 now it’s 88 to 90. Any idea?

    Keep up the good work guys.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Autoptimize is creating too many CSS files with the same code.’ is closed to new replies.