1

I have a website. I am trying to optimize my site based on the feedback I've received from Google's Website Speed Test. In my scores, I have two things I'm supposed to fix:

  • Leverage browser caching
  • Optimize images

At this time, I'm most confused about the second option. My site only has one image (that I know of) and I feel like its optimized. Is there a way I can see what images Google's test thinks are not optimized? I'm just wondering if there are some images in a third-party library that aren't optimized. I can't think of what though. For that reason, I'm really trying to figure out how I can see specifically what image(s) are not optimized.

Joe
  • 4,877
  • 5
  • 30
  • 51
user70192
  • 13,786
  • 51
  • 160
  • 240

1 Answers1

0

The best thing to do when trying to Optimise Images is to use Google's PageSpeed Insights. They offer you an option to download optimised image, JavaScript, and CSS resources for the page.

This will automatically download all images that need optimising to Google's level of optimisation.

Example Below:

PageSpeed Insights

In regards to your Leverage Browser Caching, all you need to use in your .htaccess file is:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On

## IMAGES ##
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"

## CSS ##
ExpiresByType text/css "access plus 1 month"

## HTML ##
ExpiresByType text/html "access plus 1 month"

## JAVASCRIPT ##
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"

ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/json "access plus 1 month"

ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"

ExpiresDefault "access plus 1 month"

</ifModule>

and for external JavaScript files, see my answer to this question: Leverage browser caching for 3rd party JS.

Community
  • 1
  • 1
Joe
  • 4,877
  • 5
  • 30
  • 51