Skip to content

Instantly share code, notes, and snippets.

@mahdiyazdani
Last active September 30, 2016 09:42
Show Gist options
  • Save mahdiyazdani/42d907f42946515538319b80e314d184 to your computer and use it in GitHub Desktop.
Save mahdiyazdani/42d907f42946515538319b80e314d184 to your computer and use it in GitHub Desktop.
Add Expire Headers to WordPress
# Browser Caching – Add Expire Headers to WordPress
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/gif "access pplus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment