PageSpeed Insights

You do that at the server level in .htaccess (what needs to be entered depends on your server and what cache control is available on it).

This is what's in my .htaccess with mod_expires...
Code:
<FilesMatch "\.(jpg|jpeg|png|gif|ico|js|css|less)$">
   ExpiresDefault "access plus 1 month"
</FilesMatch>

do you use memcached or redis?
 
do you use memcached or redis?
No. They don't have anything to do with the caching I'm talking about anyway. ;)

The caching I'm talking about signals the user's browser to cache the content for the files listed.
 
Don't worry about that. It's slow only on first time loadings. If Clientcaches are filled the Site is on mobile also fast ;)


<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
# CSS, JavaScript
ExpiresByType text/css "access plus 3 days"
ExpiresByType text/javascript "access plus 1 day"
ExpiresByType application/javascript "access plus 1 day"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>
 
You do that at the server level in .htaccess (what needs to be entered depends on your server and what cache control is available on it).

This is what's in my .htaccess with mod_expires...
Code:
<FilesMatch "\.(jpg|jpeg|png|gif|ico|js|css|less)$">
   ExpiresDefault "access plus 1 month"
</FilesMatch>

I have this

<IfModule mod_expires.c>
# Enable expires
ExpiresActive On

# Default a cache expiration
ExpiresDefault "access plus 10 month"

# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# CSS, JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"


# Fonts
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
AddType image/svg+xml .svg

# Compress compressible fonts
# only uncomment if you dont have compression turned on already. Otherwise it will cause all other filestypes not to get compressed
# AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-opentype image/svg+xml

ExpiresActive on

# Add a far future Expires header for fonts
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>
 
but javascripts & images has question mark and some digits, and digits are different everytime... so the rules don't apply to them as I understand.

google pagespeed suggests:

194485
 
Browsers won't cache anything with a cache buster (the ?##### after the name), or anything from an external source (like google).
 
Browsers won't cache anything with a cache buster (the ?##### after the name), or anything from an external source (like google).

So I don't get why you got an A and me & xenforo got F for cache static content.
 
My write up on PageSpeed Insights v5 update at https://community.centminmod.com/threads/google-pagespeed-insights-v5-update.16016/

The gist
Google PageSpeed Insights v5 is heavily weighted towards interactive and speedindex and first contentful paint metrics on 3G moto g4/nexus 5 device emulation. So for dynamic and javascript heavy sites, 3G mobile score will be lower. From v5 API this is the weighting used to determine the score
  • interactive 5
  • speed-index 4
  • first-contentful-paint 3
  • first-cpu-idle 2
  • first-meaningful-paint 1

But also use webpagetest.org for pagespeed testing - my guide at https://community.centminmod.com/th...getest-org-for-page-load-speed-testing.13859/

To show how unreliable google insights is, you got 50, I get 60. I've gotten 90's in the past.
If you have ads or dynamic javascript related code which changes between page loads, then yes there is a variance due to above mentioned weighting for the scores. You really shouldn't look at the overall scores but the metric's values measured over time to get your relative page speed. Field data origin summary would be that over time measurement rather than the lab data scores which is what the score rating is measured from.

edit: example for my forums using my own gitools_v5.sh pagespeed insights API test script I can compare individual metrics from previous runs to my current and can see google adsense playing a big part in lowering my mobile score https://community.centminmod.com/threads/google-pagespeed-insights-v5-update.16016/#post-70548
 
Last edited:
My cache is working... your's isn't ;)

OK, so I fixed my cache and now it works too ;)

194601

I don't load any extraneous items on my site

You mean "Featured threads" addon I use on a home page? I tried with it and without and it makes just 2 points difference. I get 46 without it (and without google ad). 44 with an addon. and 25 with an addon and a google ad.

So what is the deal with css.php?css=... ? It's listed as most crytical under "Defer unused CSS" aand also under "Eliminate render-blocking resources ".
Can anything be done about it?
 
My write up on PageSpeed Insights v5 update at https://community.centminmod.com/threads/google-pagespeed-insights-v5-update.16016/

The gist


But also use webpagetest.org for pagespeed testing - my guide at https://community.centminmod.com/th...getest-org-for-page-load-speed-testing.13859/


If you have ads or dynamic javascript related code which changes between page loads, then yes there is a variance due to above mentioned weighting for the scores. You really shouldn't look at the overall scores but the metric's values measured over time to get your relative page speed. Field data origin summary would be that over time measurement rather than the lab data scores which is what the score rating is measured from.

edit: example for my forums using my own gitools_v5.sh pagespeed insights API test script I can compare individual metrics from previous runs to my current and can see google adsense playing a big part in lowering my mobile score https://community.centminmod.com/threads/google-pagespeed-insights-v5-update.16016/#post-70548

Thanks. It's a lot of reading, so I need some time to get through it. )
However I checked https://community.centminmod.com at G pagespeed insights and can see that css.php?css= not listed neither under "Defer unused CSS" no under "Eliminate render-blocking resources ". How did you do that?
 
GTMETRIX can drive one to insanity lol. Anyone knows how to gzip these:

O4jkbs5.jpg
 
See Google: PageSpeed Insights Score Can Change Regardless of Changes to a Site

Google’s John Mueller has advised that the PageSpeed Insights score can change without any changes being made to a website. .... Mueller says these scores are not physical measurements and may change over time whether or not the website itself has been changed. Ultimately, Mueller believes these tools should be used to find ways to improve a site for users. Achieving a particular PageSpeed score should not be seen as a final goal.

According to recent PageSpeed Insights release notes (Google doc link), there was a known bug in early February that led to lower scores.
“Between Friday Feb 1st and Monday Feb 4, the headless Chrome infrastructure used by PageSpeed Insights had a bug that reported uncompressed (post-gzip) sizes as if they were the compressed transfer sizes. This led to incorrect calculations of the performance metrics and ultimately a lower score.”
The bug was completely addressed as of Monday, February 4.

However, while mobile scores will return to their previous values, desktop scores are expected to remain lower.
As explained in the release notes, PageSpeed Insights now utilizes Lighthouse version 4.1.0 under the hood.
“Desktop scoring has been recalibrated to stay on par with the fast moving world of desktop browsing based on the most current data on global page speeds. You should expect desktop scores to be lower now than they had been.”
 
Sorry, even with every explanation under the sun, there's no accounting for this when there have been no changes to a site...

yeah, it was some glitch with pagespeed insights. xenforo's site jumped up too.
but still - how come you have 95 and me just 78? )
 
Back
Top Bottom