SHOW:
|
|
- or go back to the newest paste.
1 | ## EXPIRES CACHING ## | |
2 | <IfModule mod_expires.c> | |
3 | ExpiresActive On | |
4 | AddType application/vnd.ms-fontobject .eot | |
5 | AddType application/x-font-ttf .ttf | |
6 | AddType application/x-font-opentype .otf | |
7 | AddType application/x-font-woff .woff | |
8 | AddType image/svg+xml .svg | |
9 | ExpiresByType application/vnd.ms-fontobject "access plus 1 year" | |
10 | ExpiresByType application/x-font-ttf "access plus 1 year" | |
11 | ExpiresByType application/x-font-opentype "access plus 1 year" | |
12 | ExpiresByType application/x-font-woff "access plus 1 year" | |
13 | ExpiresByType image/svg+xml "access plus 1 year" | |
14 | ExpiresByType image/jpg "access plus 1 year" | |
15 | ExpiresByType image/jpeg "access plus 1 year" | |
16 | ExpiresByType image/gif "access plus 1 year" | |
17 | ExpiresByType image/png "access plus 1 year" | |
18 | ExpiresByType text/css "access plus 1 month" | |
19 | ExpiresByType application/pdf "access plus 1 month" | |
20 | ExpiresByType text/x-javascript "access plus 1 month" | |
21 | ExpiresByType application/x-shockwave-flash "access plus 1 month" | |
22 | ExpiresByType image/x-icon "access plus 1 year" | |
23 | ExpiresDefault "access plus 2 days" | |
24 | </IfModule> | |
25 | ## EXPIRES CACHING ## | |
26 | ||
27 | ##Caching for mod_headers## | |
28 | <IfModule mod_headers.c> | |
29 | Header set Connection keep-alive | |
30 | <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf|woff)$"> | |
31 | Header set Cache-Control "max-age=2678400, public" | |
32 | </filesmatch> | |
33 | <filesmatch "\.(html|htm)$"> | |
34 | Header set Cache-Control "max-age=7200, private, must-revalidate" | |
35 | </filesmatch> | |
36 | <filesmatch "\.(pdf)$"> | |
37 | Header set Cache-Control "max-age=86400, public" | |
38 | </filesmatch> | |
39 | <filesmatch "\.(js)$"> | |
40 | Header set Cache-Control "max-age=2678400, private" | |
41 | </filesmatch> | |
42 | </IfModule> | |
43 | ## EXPIRES CACHING ## | |
44 | ||
45 | <IfModule mod_deflate.c> | |
46 | # Compress HTML, CSS, JavaScript, Text, XML and fonts | |
47 | AddOutputFilterByType DEFLATE application/javascript | |
48 | AddOutputFilterByType DEFLATE application/rss+xml | |
49 | AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
50 | AddOutputFilterByType DEFLATE application/x-font | |
51 | AddOutputFilterByType DEFLATE application/x-font-opentype | |
52 | AddOutputFilterByType DEFLATE application/x-font-otf | |
53 | AddOutputFilterByType DEFLATE application/x-font-truetype | |
54 | AddOutputFilterByType DEFLATE application/x-font-ttf | |
55 | AddOutputFilterByType DEFLATE application/x-javascript | |
56 | AddOutputFilterByType DEFLATE application/xhtml+xml | |
57 | AddOutputFilterByType DEFLATE application/xml | |
58 | AddOutputFilterByType DEFLATE font/opentype | |
59 | AddOutputFilterByType DEFLATE font/otf | |
60 | AddOutputFilterByType DEFLATE font/ttf | |
61 | AddOutputFilterByType DEFLATE image/svg+xml | |
62 | AddOutputFilterByType DEFLATE image/x-icon | |
63 | AddOutputFilterByType DEFLATE text/css | |
64 | AddOutputFilterByType DEFLATE text/html | |
65 | AddOutputFilterByType DEFLATE text/javascript | |
66 | AddOutputFilterByType DEFLATE text/plain | |
67 | AddOutputFilterByType DEFLATE text/xml | |
68 | # Remove browser bugs (only needed for really old browsers) | |
69 | BrowserMatch ^Mozilla/4 gzip-only-text/html | |
70 | BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
71 | BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | |
72 | Header append Vary User-Agent | |
73 | </IfModule> | |
74 | ||
75 | <ifModule mod_gzip.c> | |
76 | mod_gzip_on Yes | |
77 | mod_gzip_dechunk Yes | |
78 | mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ | |
79 | mod_gzip_item_include mime ^application/x-javascript.* | |
80 | mod_gzip_item_include mime ^text/.* | |
81 | mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* | |
82 | mod_gzip_item_exclude mime ^image/.* | |
83 | mod_gzip_item_include handler ^cgi-script$ | |
84 | </ifModule> |