|
| 1 | +# Brotli compression |
| 2 | +<IfModule mod_brotli.c> |
| 3 | + <IfModule mod_filter.c> |
| 4 | + AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/css application/json |
| 5 | + AddOutputFilterByType BROTLI_COMPRESS application/javascript |
| 6 | + AddOutputFilterByType BROTLI_COMPRESS text/xml application/xml text/x-component |
| 7 | + AddOutputFilterByType BROTLI_COMPRESS application/xhtml+xml application/rss+xml application/atom+xml |
| 8 | + AddOutputFilterByType BROTLI_COMPRESS image/x-icon image/svg+xml |
| 9 | + AddOutputFilterByType BROTLI_COMPRESS font/ttf font/opentype font/woff font/woff2 |
| 10 | + </IfModule> |
| 11 | +</IfModule> |
| 12 | + |
| 13 | +# Gzip compression |
| 14 | +<IfModule mod_deflate.c> |
| 15 | + <IfModule mod_filter.c> |
| 16 | + AddOutputFilterByType DEFLATE text/html text/plain text/css application/json |
| 17 | + AddOutputFilterByType DEFLATE application/javascript |
| 18 | + AddOutputFilterByType DEFLATE text/xml application/xml text/x-component |
| 19 | + AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml |
| 20 | + AddOutputFilterByType DEFLATE image/x-icon image/svg+xml |
| 21 | + AddOutputFilterByType DEFLATE font/ttf font/opentype font/woff font/woff2 |
| 22 | + </IfModule> |
| 23 | +</IfModule> |
| 24 | + |
| 25 | +# Expires headers (for better cache control) |
| 26 | +<IfModule mod_expires.c> |
| 27 | + ExpiresActive on |
| 28 | + ExpiresByType image/gif "access plus 1 year" |
| 29 | + ExpiresByType image/png "access plus 1 year" |
| 30 | + ExpiresByType image/jpeg "access plus 1 year" |
| 31 | + ExpiresByType image/webp "access plus 1 year" |
| 32 | + ExpiresByType image/svg+xml "access plus 1 year" |
| 33 | + ExpiresByType image/x-icon "access plus 1 year" |
| 34 | + ExpiresByType video/ogg "access plus 1 year" |
| 35 | + ExpiresByType audio/ogg "access plus 1 year" |
| 36 | + ExpiresByType video/mp4 "access plus 1 year" |
| 37 | + ExpiresByType video/webm "access plus 1 year" |
| 38 | + ExpiresByType text/x-component "access plus 1 year" |
| 39 | + ExpiresByType font/opentype "access plus 1 year" |
| 40 | + ExpiresByType font/ttf "access plus 1 year" |
| 41 | + ExpiresByType font/woff "access plus 1 year" |
| 42 | + ExpiresByType font/woff2 "access plus 1 year" |
| 43 | + ExpiresByType text/css "access plus 1 year" |
| 44 | + ExpiresByType application/javascript "access plus 1 year" |
| 45 | +</IfModule> |
| 46 | + |
| 47 | +# Do not cache source map files |
| 48 | +<IfModule mod_headers.c> |
| 49 | + <FilesMatch "\.map$"> |
| 50 | + Header set Expires "0" |
| 51 | + Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform" |
| 52 | + </FilesMatch> |
| 53 | +</IfModule> |
0 commit comments