Skip to content

Instantly share code, notes, and snippets.

@zottto
Created December 15, 2017 12:06
Show Gist options
  • Save zottto/6e043b5010702a30ca9a1217044ffdc8 to your computer and use it in GitHub Desktop.
Save zottto/6e043b5010702a30ca9a1217044ffdc8 to your computer and use it in GitHub Desktop.
Default Apache configuration for WordPress performance optimizations
# Keep-Alive
<IfModule mod_headers.c>
Header set Connection Keep-Alive
</IfModule>
# Compress Transfer
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript application/json application/ld+json \
application/rss+xml application/vnd.ms-fontobject \
application/x-font-ttf application/x-web-app-manifest+json \
application/xhtml+xml application/xml font/opentype \
image/svg+xml image/x-icon \
text/css text/html text/plain text/vtt text/x-component text/xml
</IfModule>
# Cache static content
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 week"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresByType text/x-component "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
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"
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/font-woff "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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment