Leverage Browser Caching
-
I’ve just tried this plugin because it looks really great, but I can’t find the setting to enable “Leverage Browser Caching” which should be available according to the specs.
-
Hi,
You can find it under Settings > Caching > General
https://www.evernote.com/l/AkB-Vv7ptO5DKpmm7elLY9b8bCMu1-uyCE4Just check Enable Browser Cache option
https://www.evernote.com/l/AkDiwm19vVtEdL2mVSPX_tlNRB9aQk5c8MoI must have missed it, but I see it’s on by default and so it is on the site I’m testing the plugin on. GTMetrix however shows it needs optimization. So I still need to add the Expire headers rules to my .htaccess myself. I was hoping that your plugin would take care of it.
Are you using Apache or Litespeed?
Nginx in front of Apache
Strange. And static files are served by Apache or Nginx? Can you also copy the htaccess code which solved the issue?
Thanks!
Apache, I guess…
When I add the following lines to .htaccess of the site it’s fine. That’s how I did it before, but as I said, I was wondering if your plugin would take care of that.
## EXPIRES CACHING ## <IfModule mod_expires.c> # 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" 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 text/css "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/x-javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresDefault "access plus 2 days" </IfModule> ## EXPIRES CACHING ##The plugin adds the following rules (so I am not sure why it isn’t working :-/):
# ——————————————————————————
# | Expires headers (for better cache control) |
# ——————————————————————————
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault “access plus 1 month”# CSS
ExpiresByType text/css “access plus 1 year”# Data interchange
ExpiresByType application/json “access plus 0 seconds”
ExpiresByType application/xml “access plus 0 seconds”
ExpiresByType text/xml “access plus 0 seconds”# Favicon (cannot be renamed!)
ExpiresByType image/x-icon “access plus 1 week”# HTML components (HTCs)
ExpiresByType text/x-component “access plus 1 month”# HTML
ExpiresByType text/html “access plus 0 seconds”# JavaScript
ExpiresByType application/javascript “access plus 1 year”# Manifest files
ExpiresByType application/x-web-app-manifest+json “access plus 0 seconds”
ExpiresByType text/cache-manifest “access plus 0 seconds”# Media
ExpiresByType audio/ogg “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType video/mp4 “access plus 1 month”
ExpiresByType video/ogg “access plus 1 month”
ExpiresByType video/webm “access plus 1 month”# Web feeds
ExpiresByType application/atom+xml “access plus 1 hour”
ExpiresByType application/rss+xml “access plus 1 hour”# Web fonts
ExpiresByType application/font-woff “access plus 1 month”
ExpiresByType application/font-woff2 “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”
ExpiresByType application/x-font-ttf “access plus 1 month”
ExpiresByType font/opentype “access plus 1 month”
ExpiresByType image/svg+xml “access plus 1 month”</IfModule>
Neither am I. I’ll test it tomorrow on another website and do a test with all plugins deactivated to check for a conflict.
At least it’s not an issue, that .htaccess isn’t writable, because other lines are added by Swift Performance.
The topic ‘Leverage Browser Caching’ is closed to new replies.