Skip to content

Instantly share code, notes, and snippets.

@jaikt
Last active May 9, 2023 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaikt/cffe67e091c4b35c942df898991639c5 to your computer and use it in GitHub Desktop.
Save jaikt/cffe67e091c4b35c942df898991639c5 to your computer and use it in GitHub Desktop.
# Enable caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
# Set specific expiration times for different file types
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
</IfModule>
# Enable gzip compression
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/x-javascript application/json
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment