• Hi.

    I ran a google pagespeed test. Their main recommendation is that I leverage browser caching.

    They state “The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources”

    How can I specify an expiration date of at least 1 week though? Is there a plugin perhaps?

    I saw W3 cache plugin but I didn’t see any where to specify a time.

    Thanks for any help,

    Mark

Viewing 2 replies - 1 through 2 (of 2 total)
  • Browser caching can be achieved with mod_expires.c modules (Apache install) – below goes at the very top of .htaccess file in root of install:

    <IfModule mod_expires.c>
        ExpiresActive on
        ExpiresByType text/css "access plus 14 days"
        ExpiresByType text/javascript "access plus 14 days"
        ExpiresByType application/x-javascript "access plus 14 days"
        ExpiresByType image/ico "access plus 14 days"
        ExpiresByType image/jpg "access plus 14 days"
        ExpiresByType image/jpeg "access plus 14 days"
        ExpiresByType image/gif "access plus 14 days"
        ExpiresByType image/png "access plus 14 days"
        ExpiresByType text/css "access plus 14 days"
        ExpiresByType text/html "access plus 14 days"
    </IfModule>

    Change to # of days desired but they are looking for 14 days at least..
    https://httpd.apache.org/docs/2.2/mod/mod_expires.html

    Thread Starter markylad

    (@markylad)

    Thanks very much for your help ??
    Pardon my ignorance but can I just copy and paste that into my .htaccess file?
    I’m not sure what mod_expires.c modules (Apache install) means. Have I to download or install anything or just amend the .htaccess fie?
    Thank you.

    [Please don’t bump]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How To Leverage Browser Caching In WordPress?’ is closed to new replies.