Disable mod_pagespeed (no server conf access, .htaccess doesn’t work)
Create a .htaccess file, add below text and upload using ftp program. We are also a hosting provider and use Pagespeed. Modpagespeed Off
Create a .htaccess file, add below text and upload using ftp program. We are also a hosting provider and use Pagespeed. Modpagespeed Off
Google Tag Manager is by definition a performance impediment. Its only purpose is to allow non-technical people to dump random garbage very important third-party scripts on a site. If you bypass GTM by inserting the external tags/scripts that you want on your site directly, it will improve performance immediately. If you can’t do that, you … Read more
Try this, which is something I edited a while ago from the jQuerify bookmarklet. I use it frequently to load jQuery and execute stuff after it’s loaded. You can of course replace the url there with your own url to your customized jquery. (function() { function getScript(url,success){ var script=document.createElement(‘script’); script.src=url; … Read more
You can preload any styles (including google fonts) <link rel=”preload” href=”https://fonts.googleapis.com/css?family=Open+Sans:300&display=swap” as=”style” onload=”this.onload=null;this.rel=”stylesheet”” /> <noscript> <link href=”https://fonts.googleapis.com/css?family=Open+Sans:300&display=swap” rel=”stylesheet” type=”text/css” /> </noscript> You can read more on web.dev UPDATE Base on Lucas Vazquez comment I’ve also added &display=swap (which fixes this issue “Ensure text remains visible during webfont load”)
Inlining all your CSS means it cannot be cached, so every single page load will contain all of the CSS required, and when you are using large libraries that can really be a lot of wasted bandwidth. For example, Bootstrap is around 120k. Note the Google link you shared specifies the following (emphasis mine): If … Read more
I guess it’s meant that you enable gzip compression for your css and js files, because that will enable the client to receive both gzip-encoded content and a plain content. This is how to do it in apache2: <IfModule mod_deflate.c> #The following line is enough for .js and .css AddOutputFilter DEFLATE js css #The following … Read more
If you’re really interested in the technical details, check out the source code: png_optimizer.cc jpeg_optimizer.cc webp_optimizer.cc For PNG files, they use OptiPNG with some trial-and-error approach // we use these four combinations because different images seem to benefit from // different parameters and this combination of 4 seems to work best for a large // … Read more
A related question has been asked before: What is “above-the-fold content” in Google Pagespeed? Firstly you have to notice that this is all about ‘mobile pages‘. So when I interpreted your question and screenshot correctly, then this is not for your site! On the contrary – doing some of the things advised by Google in … Read more
Well, if Google is cheating on you, you can cheat Google back: This is the user-agent for pageSpeed: “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.8 (KHTML, like Gecko; Google Page Speed Insights) Chrome/19.0.1084.36 Safari/536.8” You can insert a conditional to avoid serving the analytics script to PageSpeed: <?php if (!isset($_SERVER[‘HTTP_USER_AGENT’]) || stripos($_SERVER[‘HTTP_USER_AGENT’], ‘Speed Insights’) === false): ?> … Read more