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.
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.
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.
I +1 on what Saumya wrote! π
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.