ExpiresActive On.htaccess explanation

[i]ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
BrowserMatch "MSIE" brokenvary=1
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
BrowserMatch "Opera" !brokenvary
SetEnvIf brokenvary 1 force-no-vary[/i]

Saw this code in .htaccess example recently.

ExpiresByType presumably sets the expiration time on images - is this related to the browser browser cache? and what does the A2592000 mean on?

and what does breakvary = 1 mean? I collect it to search for UserAgent, but then what?

thank!

+3
source share
2 answers

ExpiresByType supposedly sets the expiration time on images - is this related to the browser browser cache?

Yes. mod_expires makes it easy to set type-based expiration rules.

. , , , :

( 14.9), (. 13.8) , , , .

, , (.. no-store), ( ), ( ).


A2592000?

(, "2010-10-09" ), (, "" ). A2592000 , A , 2592000 - . , A2592000 "2592000 ".


"brokenvary = 1"? UserAgent, ?

Apache , force-no-vary :

Vary , . ; . force-response-1.0.

Vary , :

Vary, , , .

, URL-, /document.html, (, ), , Accept-Language de, Vary, Accept-Language, , Accept-Language.

. Vary , , force-no-vary.

+10

ExpiresByType - Apache mod_expires, HTTP "Expires" "Cache-control". , .

(http://httpd.apache.org/docs/2.0/mod/mod_expires.html):

'A' means the client access time should be used.

:

# enable expirations
ExpiresActive On
# expire GIF images after a month in the client cache
ExpiresByType image/gif A2592000
# HTML documents are good for a week from the
# time they were changed
ExpiresByType text/html M604800
+2

Source: https://habr.com/ru/post/1768598/


All Articles