Manolo
Manolo

Reputation: 26370

Leverage browser caching (internal)

I'm getting the below with PageSpeed Insights:

Leverage browser caching

But in my Apache site configuration I have:

    <IfModule mod_expires.c>

             ExpiresActive On
             ExpiresDefault "access plus 1 seconds"
             ExpiresByType text/html "access plus 1 seconds"
             ExpiresByType text/css "access plus 2 weeks"
             ExpiresByType text/javascript "access plus 2 weeks"
             ExpiresByType application/x-javascript "access plus 2 weeks"
             ExpiresByType image/* "access plus 2 weeks"

    </IfModule>

mod_expires is enabled. And seems to work, since other css, jpg, png, ... files are cached. But some js and css files are not. What am I doing wrong?

You can try at http://itransformer.es

Upvotes: 0

Views: 219

Answers (1)

Narrim
Narrim

Reputation: 570

I believe that apache uses application/javascript to represent js files

ExpiresByType application/javascript "access plus 2 weeks"

If you check in apaches mime.types text/javascript is commented out.

I would additionally suggest that you look at optimizing your sites images

http://itransformer.es/public/img/carrete.png is resized in HTML or CSS from 2135x1555 to 300x219. Serving a scaled image could save 561.5KiB (98% reduction).
http://itransformer.es/public/img/logo.png is resized in HTML or CSS from 608x99 to 500x81. Serving a scaled image could save 29.3KiB (33% reduction).
http://itransformer.es/public/img/carrete2.png is resized in HTML or CSS from 2000x298 to 1903x284. Serving a scaled image could save 3.7KiB (10% reduction).
http://itransformer.es/public/img/gplus.png is resized in HTML or CSS from 62x64 to 35x36. Serving a scaled image could save 1.9KiB (68% reduction).
http://itransformer.es/public/img/tw.png is resized in HTML or CSS from 62x64 to 35x36. Serving a scaled image could save 1.5KiB (68% reduction).
http://itransformer.es/public/img/fb.png is resized in HTML or CSS from 62x64 to 35x36. Serving a scaled image could save 1.0KiB (68% reduction).

They are some big images to load on a landing page and really slow the first acces load times. make sure when your looking at the page load you turn off your own browser cache to simulate someone entering for the first time.

Good Luck Narimm

Upvotes: 4

Related Questions