|
61 | 61 | SecFilterScanPOST Off
|
62 | 62 | </IfModule>
|
63 | 63 |
|
| 64 | +############################################ |
| 65 | +## setting MIME types |
| 66 | + |
| 67 | +# JavaScript |
| 68 | +AddType application/javascript js jsonp |
| 69 | +AddType application/json json |
| 70 | + |
| 71 | +# CSS |
| 72 | +AddType text/css css |
| 73 | + |
| 74 | +# Images and icons |
| 75 | +AddType image/x-icon ico |
| 76 | +AddType image/gif gif |
| 77 | +AddType image/png png |
| 78 | +AddType image/jpeg jpg |
| 79 | +AddType image/jpeg jpeg |
| 80 | + |
| 81 | +# SVG |
| 82 | +AddType image/svg+xml svg |
| 83 | + |
| 84 | +# Fonts |
| 85 | +AddType application/vnd.ms-fontobject eot |
| 86 | +AddType application/x-font-ttf ttf |
| 87 | +AddType application/x-font-otf otf |
| 88 | +AddType application/x-font-woff woff |
| 89 | +AddType application/font-woff2 woff2 |
| 90 | + |
| 91 | +# Flash |
| 92 | +AddType application/x-shockwave-flash swf |
| 93 | + |
| 94 | +# Archives and exports |
| 95 | +AddType application/zip gzip |
| 96 | +AddType application/x-gzip gz gzip |
| 97 | +AddType application/x-bzip2 bz2 |
| 98 | +AddType text/csv csv |
| 99 | +AddType application/xml xml |
| 100 | + |
64 | 101 | <IfModule mod_headers.c>
|
65 | 102 | ############################################
|
66 | 103 | ## prevent clickjacking
|
67 | 104 |
|
68 | 105 | Header set X-Frame-Options SAMEORIGIN
|
| 106 | + |
| 107 | + Header append Cache-Control no-cache |
| 108 | + |
| 109 | + <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|htm)$> |
| 110 | + Header append Cache-Control public |
| 111 | + </FilesMatch> |
| 112 | + |
| 113 | + <FilesMatch .*\.(zip|gz|gzip|bz2|csv|xml)$> |
| 114 | + Header append Cache-Control no-store |
| 115 | + </FilesMatch> |
| 116 | + |
| 117 | + <FilesMatch ".(html)$"> |
| 118 | + Header append Vary: Accept-Encoding |
| 119 | + </FilesMatch> |
| 120 | + |
69 | 121 | </IfModule>
|
70 | 122 |
|
71 | 123 | <IfModule mod_deflate.c>
|
|
166 | 218 | ## Add default Expires header
|
167 | 219 | ## http://developer.yahoo.com/performance/rules.html#expires
|
168 | 220 |
|
169 |
| - <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|ttf|otf|woff|woff2|ogg|mp4|webm)$> |
170 |
| - Header append Cache-Control private |
171 |
| - </FilesMatch> |
172 |
| - |
173 | 221 | ExpiresActive On
|
174 | 222 |
|
175 |
| - <FilesMatch \.(html|xhtml|xml|shtml|phtml|php|txt)$> |
| 223 | + # Data |
| 224 | + <FilesMatch \.(html|xhtml|shtml|phtml|php|txt|zip|gz|gzip|bz2|csv|xml)$> |
176 | 225 | ExpiresDefault "access plus 0 seconds"
|
177 | 226 | </FilesMatch>
|
178 |
| - |
179 | 227 | ExpiresByType text/html "access plus 0 seconds"
|
180 |
| - |
181 |
| - # Data |
182 | 228 | ExpiresByType text/xml "access plus 0 seconds"
|
183 |
| - ExpiresByType application/xml "access plus 0 seconds" |
| 229 | + ExpiresByType text/csv "access plus 0 seconds" |
184 | 230 | ExpiresByType application/json "access plus 0 seconds"
|
| 231 | + ExpiresByType application/zip "access plus 0 seconds" |
| 232 | + ExpiresByType application/x-gzip "access plus 0 seconds" |
| 233 | + ExpiresByType application/x-bzip2 "access plus 0 seconds" |
| 234 | + |
| 235 | + # CSS, JavaScript |
| 236 | + <FilesMatch \.(css|js)$> |
| 237 | + ExpiresDefault "access plus 1 year" |
| 238 | + </FilesMatch> |
| 239 | + ExpiresByType text/css "access plus 1 year" |
| 240 | + ExpiresByType application/javascript "access plus 1 year" |
185 | 241 |
|
186 |
| - # MFavicon, images, video, audio |
187 |
| - <FilesMatch \.(ico|gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$> |
| 242 | + # Favicon, images, flash |
| 243 | + <FilesMatch \.(ico|gif|png|jpg|jpeg|swf|svg)$> |
188 | 244 | ExpiresDefault "access plus 1 year"
|
189 | 245 | </FilesMatch>
|
190 | 246 | ExpiresByType image/gif "access plus 1 year"
|
191 | 247 | ExpiresByType image/png "access plus 1 year"
|
192 | 248 | ExpiresByType image/jpg "access plus 1 year"
|
193 | 249 | ExpiresByType image/jpeg "access plus 1 year"
|
194 |
| - ExpiresByType image/svg "access plus 1 year" |
195 |
| - ExpiresByType video/ogg "access plus 1 year" |
196 |
| - ExpiresByType audio/ogg "access plus 1 year" |
197 |
| - ExpiresByType video/mp4 "access plus 1 year" |
198 |
| - ExpiresByType video/webm "access plus 1 year" |
| 250 | + ExpiresByType image/svg+xml "access plus 1 year" |
199 | 251 |
|
200 | 252 | # Fonts
|
201 | 253 | <FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$>
|
202 | 254 | ExpiresDefault "access plus 1 year"
|
203 | 255 | </FilesMatch>
|
| 256 | + ExpiresByType application/vnd.ms-fontobject "access plus 1 year" |
204 | 257 | ExpiresByType application/x-font-ttf "access plus 1 year"
|
205 |
| - ExpiresByType font/opentype "access plus 1 year" |
| 258 | + ExpiresByType application/x-font-otf "access plus 1 year" |
206 | 259 | ExpiresByType application/x-font-woff "access plus 1 year"
|
207 |
| - ExpiresByType image/svg+xml "access plus 1 year" |
208 |
| - ExpiresByType application/vnd.ms-fontobject "access plus 1 year" |
209 |
| - |
210 |
| - # CSS, JavaScript |
211 |
| - <FilesMatch \.(css|js)$> |
212 |
| - ExpiresDefault "access plus 1 year" |
213 |
| - </FilesMatch> |
214 |
| - ExpiresByType text/css "access plus 1 year" |
215 |
| - ExpiresByType application/javascript "access plus 1 year" |
| 260 | + ExpiresByType application/font-woff2 "access plus 1 year" |
216 | 261 |
|
217 | 262 | </IfModule>
|
218 | 263 |
|
|
234 | 279 | ## http://developer.yahoo.com/performance/rules.html#etags
|
235 | 280 |
|
236 | 281 | #FileETag none
|
237 |
| - #FileETag MTime Size |
|
0 commit comments