Last active
December 29, 2021 09:23
-
-
Save bendasvadim/745a2aec17cccf1add6c69c918dcbd21 to your computer and use it in GitHub Desktop.
Кеширование для .htaccess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddDefaultCharset UTF-8 | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access 7 days" | |
ExpiresByType application/javascript "access plus 1 year" | |
ExpiresByType text/javascript "access plus 1 year" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType text/html "access plus 7 day" | |
ExpiresByType text/x-javascript "access 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" | |
ExpiresByType image/jpg "access plus 1 year" | |
ExpiresByType image/x-icon "access 1 year" | |
ExpiresByType application/x-shockwave-flash "access 1 year" | |
ExpiresByType application/x-font-ttf "access plus 1 month" | |
ExpiresByType font/opentype "access plus 1 month" | |
ExpiresByType application/x-font-woff "access plus 1 month" | |
ExpiresByType image/svg+xml "access plus 1 month" | |
ExpiresByType application/vnd.ms-fontobject "access plus 1 month" | |
</IfModule> | |
<ifModule mod_headers.c> | |
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> | |
<filesMatch "\.(css|js)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> | |
<filesMatch "\.(xml|txt)$"> | |
Header set Cache-Control "max-age=172800, public, must-revalidate" | |
</filesMatch> | |
<filesMatch "\.(html|htm|php)$"> | |
Header set Cache-Control "max-age=172800, private, must-revalidate" | |
</filesMatch> | |
</ifModule> | |
<IfModule mod_setenvif.c> | |
BrowserMatch "MSIE" force-no-vary | |
BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary | |
</IfModule> | |
#FileETag MTime Size | |
<ifmodule mod_expires.c> | |
<filesmatch ".(jpg|jpeg|gif|png|ico|css|js)$"> | |
ExpiresActive on | |
ExpiresDefault "access plus 1 year" | |
</filesmatch> | |
</ifmodule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment