1+
2+ ##### Optimize default expiration time - BEGIN
3+ <IfModule mod_expires.c >
4+ ## Enable expiration control
5+ ExpiresActive On
6+
7+ ## CSS and JS expiration: 1 week after request
8+ ExpiresByType text/css "now plus 1 week"
9+ ExpiresByType application/javascript "now plus 1 week"
10+ ExpiresByType application/x-javascript "now plus 1 week"
11+
12+ ## Image files expiration: 1 month after request
13+ ExpiresByType image/bmp "now plus 1 month"
14+ ExpiresByType image/gif "now plus 1 month"
15+ ExpiresByType image/jpeg "now plus 1 month"
16+ ExpiresByType image/jp2 "now plus 1 month"
17+ ExpiresByType image/pipeg "now plus 1 month"
18+ ExpiresByType image/png "now plus 1 month"
19+ ExpiresByType image/svg+xml "now plus 1 month"
20+ ExpiresByType image/tiff "now plus 1 month"
21+ ExpiresByType image/x-icon "now plus 1 month"
22+ ExpiresByType image/ico "now plus 1 month"
23+ ExpiresByType image/icon "now plus 1 month"
24+ ExpiresByType text/ico "now plus 1 month"
25+ ExpiresByType application/ico "now plus 1 month"
26+ ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
27+
28+ ## Font files expiration: 1 week after request
29+ ExpiresByType application/x-font-ttf "now plus 1 week"
30+ ExpiresByType application/x-font-opentype "now plus 1 week"
31+ ExpiresByType application/x-font-woff "now plus 1 week"
32+ ExpiresByType font/woff2 "now plus 1 week"
33+ ExpiresByType image/svg+xml "now plus 1 week"
34+
35+ ## Audio files expiration: 1 month after request
36+ ExpiresByType audio/ogg "now plus 1 month"
37+ ExpiresByType application/ogg "now plus 1 month"
38+ ExpiresByType audio/basic "now plus 1 month"
39+ ExpiresByType audio/mid "now plus 1 month"
40+ ExpiresByType audio/midi "now plus 1 month"
41+ ExpiresByType audio/mpeg "now plus 1 month"
42+ ExpiresByType audio/mp3 "now plus 1 month"
43+ ExpiresByType audio/x-aiff "now plus 1 month"
44+ ExpiresByType audio/x-mpegurl "now plus 1 month"
45+ ExpiresByType audio/x-pn-realaudio "now plus 1 month"
46+ ExpiresByType audio/x-wav "now plus 1 month"
47+
48+ ## Movie files expiration: 1 month after request
49+ ExpiresByType application/x-shockwave-flash "now plus 1 month"
50+ ExpiresByType x-world/x-vrml "now plus 1 month"
51+ ExpiresByType video/x-msvideo "now plus 1 month"
52+ ExpiresByType video/mpeg "now plus 1 month"
53+ ExpiresByType video/mp4 "now plus 1 month"
54+ ExpiresByType video/quicktime "now plus 1 month"
55+ ExpiresByType video/x-la-asf "now plus 1 month"
56+ ExpiresByType video/x-ms-asf "now plus 1 month"
57+ </IfModule >
58+ ##### Optimize default expiration time - END
59+
60+ ##### 1 Month for most static resources
61+ <filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
62+ Header set Cache-Control "max-age=2592000 , public"
63+ </filesMatch>
64+
65+ ##### Enable gzip compression for resources
66+ <ifModule mod_gzip.c>
67+ mod_gzip_on Yes
68+ mod_gzip_dechunk Yes
69+ mod_gzip_item_include file .(html?|txt|css|js|php)$
70+ mod_gzip_item_include handler ^cgi-script$
71+ mod_gzip_item_include mime ^text/.*
72+ mod_gzip_item_include mime ^application/x-javascript.*
73+ mod_gzip_item_exclude mime ^image/.*
74+ mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
75+ </ifModule>
76+
77+ <FilesMatch *.(html|css|jpg|jpeg|png|gif|js|ico) >
78+ SetOutputFilter DEFLATE
79+ </FilesMatch >
80+
81+ ##### Set Header Vary: Accept-Encoding
82+ <IfModule mod_headers.c >
83+ <FilesMatch ".(js|css|xml|gz|html)$" >
84+ Header append Vary: Accept-Encoding
85+ </FilesMatch >
86+ </IfModule >
0 commit comments