Cache and gzip errors

29 views
Skip to first unread message

Nikos Antoniadis

unread,
Aug 26, 2015, 6:06:38 PM8/26/15
to pagespeed-insights-discuss
Hello,

Pagespeed Insights says that my website https://odigospolis.gr doesn't have compression and doesn't use cache.

However, I am pretty sure that I have enabled both of them via .htaccess. I have run tests on other websites and each one of them is saying that I am using them.

Am I doing something wrong?

Thank you in advance for your time.

Nick Antoniadis

David Berry

unread,
Aug 26, 2015, 10:48:15 PM8/26/15
to pagespeed-insights-discuss
One of the things that you can do is look in the headers to see if items really are being cached or not.  So open up the Chrome Dev Tools, go to the "Network" panel and then reload your page.  You will see the request for each file on your page.  By clicking on one of interest, you can inspect the headers to confirm what is going on.  This is a screenshot of a request from usatoday.com to show you what a response looks like that is both gzipped and cached


Looking at your site, the recommendation around compression is all around your CSS and JavaScript.  And indeed, looking for the headers of those files, they are not compressed.



So I think what you want to do is go back and check your setup.  You mentioned an .htaccess file, so are you running apache?  It has been a long time since I used apache, but this article might help.  Also, it might be that out of the box that only text/html files are getting compressed.  In this case, you have to add the appropriate mime types to get other static files (JS, CSS) to compress.


http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/


Caching
Looking at the recommendation for caching, all of those files are served from other servers than yours.  (3 from an Amazon S3 server and 2 from Google).  So caching this file is something that you have no control over.  In the case of the Google libraries, typically component providers keep these cache times short so that if they push out a new version, someone does not have the old (stale) version for too long a period of time.  

What I would tell you is to try to get compression fixed, then take care of the Optimize images recommendation.  Then see where you are.  Remember, this is just a score, and you are probably never going to achieve a perfect score.  You want to make sure your score is relatively high, but don't let perfect be the enemy of good here.

Reply all
Reply to author
Forward
0 new messages