Skip to content

Instantly share code, notes, and snippets.

@andrebian
Created March 25, 2015 16:33
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 andrebian/cbdb11799bb4e60f32df to your computer and use it in GitHub Desktop.
Save andrebian/cbdb11799bb4e60f32df to your computer and use it in GitHub Desktop.
Um .htaccess para melhoras significativas de pagespeed
# Ativando compactação
<FilesMatch ".(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
# Ativando cache no browser
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 week"
# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 month"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS and JavaScript
# ExpiresByType text/css "access plus 1 week"
# ExpiresByType application/javascript "access plus 1 week"
# ExpiresByType text/javascript "access plus 1 week"
# Para ativar cache de js e css descomente as linhas acima
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment