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