Skip to content

Instantly share code, notes, and snippets.

@rmzse
Forked from bouveng/.htaccess
Created June 2, 2020 21:38
Show Gist options
  • Select an option

  • Save rmzse/f21d4d189b2460b9426496584c450fe5 to your computer and use it in GitHub Desktop.

Select an option

Save rmzse/f21d4d189b2460b9426496584c450fe5 to your computer and use it in GitHub Desktop.
<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|webp|svg|gif|woff|woff2|js|css)$">
Header set Cache-Control "max-age=31536000, public"
Header append Vary: Accept-Encoding
Header set Access-Control-Allow-Origin “*”
</filesMatch>
<ifmodule mod_deflate.c>
<ifmodule mod_mime.c>
AddType application/x-font-ttf .ttf
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
</ifmodule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript text/text application/x-font-ttf application/font-woff application/font-woff2
</ifmodule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpg A31536000
ExpiresByType image/svg+xml A31536000
ExpiresByType image/gif A31536000
ExpiresByType image/jpeg A31536000
ExpiresByType image/png A31536000
ExpiresByType text/css A31536000
ExpiresByType text/javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType image/ico A31536000
ExpiresByType image/x-icon A31536000
ExpiresByType application/font-woff A31536000
ExpiresByType application/font-woff2 A31536000
ExpiresByType application/x-font-ttf A31536000
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment