Skip to content

Commit 0b130ab

Browse files
committed
MAGETWO-31196: ETag support on frontend, expiration/lifetime management
1 parent 1bba5fe commit 0b130ab

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

.htaccess

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,53 @@
166166
## Add default Expires header
167167
## http://developer.yahoo.com/performance/rules.html#expires
168168

169-
ExpiresDefault "access plus 1 year"
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+
ExpiresActive On
174+
175+
<FilesMatch \.(html|xhtml|xml|shtml|phtml|php|txt)$>
176+
ExpiresDefault "access plus 0 seconds"
177+
</FilesMatch>
178+
179+
ExpiresByType text/html "access plus 0 seconds"
180+
181+
# Data
182+
ExpiresByType text/xml "access plus 0 seconds"
183+
ExpiresByType application/xml "access plus 0 seconds"
184+
ExpiresByType application/json "access plus 0 seconds"
185+
186+
# MFavicon, images, video, audio
187+
<FilesMatch \.(ico|gif|png|jpg|jpeg|ogg|mp4|mkv|flv|swf|wmv|asf|asx|wma|wax|wmx|wm)$>
188+
ExpiresDefault "access plus 1 year"
189+
</FilesMatch>
190+
ExpiresByType image/gif "access plus 1 year"
191+
ExpiresByType image/png "access plus 1 year"
192+
ExpiresByType image/jpg "access plus 1 year"
193+
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"
199+
200+
# Fonts
201+
<FilesMatch \.(eot|ttf|otf|svg|woff|woff2)$>
202+
ExpiresDefault "access plus 1 year"
203+
</FilesMatch>
204+
ExpiresByType application/x-font-ttf "access plus 1 year"
205+
ExpiresByType font/opentype "access plus 1 year"
206+
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"
170216

171217
</IfModule>
172218

@@ -188,3 +234,4 @@
188234
## http://developer.yahoo.com/performance/rules.html#etags
189235

190236
#FileETag none
237+
#FileETag MTime Size

0 commit comments

Comments
 (0)