Commit 6d577a1607663dd6a993f02ff0de269e817bc7e5
1 parent
c0c8b24e
htaccess cache
Showing
1 changed file
with
58 additions
and
58 deletions
 
Show diff stats
.htaccess
| @@ -97,63 +97,63 @@ AddDefaultCharset utf-8 | @@ -97,63 +97,63 @@ AddDefaultCharset utf-8 | ||
| 97 | 97 | ||
| 98 | # кеширование в браузере на стороне пользователя | 98 | # кеширование в браузере на стороне пользователя | 
| 99 | 99 | ||
| 100 | -#<IfModule mod_expires.c> | ||
| 101 | -# ExpiresActive On | ||
| 102 | -# ExpiresDefault "access 7 days" | ||
| 103 | -# ExpiresByType application/javascript "access plus 1 year" | ||
| 104 | -# ExpiresByType text/javascript "access plus 1 year" | ||
| 105 | -# ExpiresByType text/css "access plus 1 year" | ||
| 106 | -# ExpiresByType text/html "access plus 7 day" | ||
| 107 | -# ExpiresByType text/x-javascript "access 1 year" | ||
| 108 | -# ExpiresByType image/gif "access plus 1 year" | ||
| 109 | -# ExpiresByType image/jpeg "access plus 1 year" | ||
| 110 | -# ExpiresByType image/png "access plus 1 year" | ||
| 111 | -# ExpiresByType image/jpg "access plus 1 year" | ||
| 112 | -# ExpiresByType image/x-icon "access 1 year" | ||
| 113 | -# ExpiresByType application/x-shockwave-flash "access 1 year" | ||
| 114 | -# </IfModule> | ||
| 115 | -#<IfModule mod_deflate.c> | ||
| 116 | -#AddOutputFilterByType DEFLATE text/plain | ||
| 117 | -#AddOutputFilterByType DEFLATE text/html | ||
| 118 | -#AddOutputFilterByType DEFLATE text/xml | ||
| 119 | -#AddOutputFilterByType DEFLATE text/css | ||
| 120 | -#AddOutputFilterByType DEFLATE application/xml | ||
| 121 | -#AddOutputFilterByType DEFLATE application/xhtml+xml | ||
| 122 | -#AddOutputFilterByType DEFLATE application/rss+xml | ||
| 123 | -#AddOutputFilterByType DEFLATE application/javascript | ||
| 124 | -#AddOutputFilterByType DEFLATE application/x-javascript | ||
| 125 | -#BrowserMatch ^Mozilla/4 gzip-only-text/html | ||
| 126 | -#BrowserMatch ^Mozilla/4\.0[678] no-gzip | ||
| 127 | -#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | ||
| 128 | -#Header append Vary User-Agent | ||
| 129 | -#RewriteEngine On | ||
| 130 | -#AddEncoding gzip .gz | ||
| 131 | -#RewriteCond %{HTTP:Accept-encoding} gzip | ||
| 132 | -#RewriteCond %{REQUEST_FILENAME}.gz -f | ||
| 133 | -#RewriteRule ^(.*)$ $1.gz [QSA,L] | ||
| 134 | -#</IfModule> | ||
| 135 | -# Cache-Control | ||
| 136 | -#<ifModule mod_headers.c> | ||
| 137 | -## 30 дней | ||
| 138 | -# <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> | ||
| 139 | -# Header set Cache-Control "max-age=2592000, public" | ||
| 140 | -# </filesMatch> | ||
| 141 | -# # 30 дней | ||
| 142 | -# <filesMatch "\.(css|js)$"> | ||
| 143 | -# Header set Cache-Control "max-age=2592000, public" | ||
| 144 | -# </filesMatch> | ||
| 145 | -# # 2 дня | ||
| 146 | -# <filesMatch "\.(xml|txt)$"> | ||
| 147 | -# Header set Cache-Control "max-age=172800, public, must-revalidate" | ||
| 148 | -# </filesMatch> | ||
| 149 | -# # 1 день | ||
| 150 | -# <filesMatch "\.(html|htm|php)$"> | ||
| 151 | -# Header set Cache-Control "max-age=172800, private, must-revalidate" | ||
| 152 | -# </filesMatch> | ||
| 153 | -#</ifModule> | 100 | +<IfModule mod_expires.c> | 
| 101 | + ExpiresActive On | ||
| 102 | + ExpiresDefault "access 7 days" | ||
| 103 | + ExpiresByType application/javascript "access plus 1 year" | ||
| 104 | + ExpiresByType text/javascript "access plus 1 year" | ||
| 105 | + ExpiresByType text/css "access plus 1 year" | ||
| 106 | + ExpiresByType text/html "access plus 7 day" | ||
| 107 | + ExpiresByType text/x-javascript "access 1 year" | ||
| 108 | + ExpiresByType image/gif "access plus 1 year" | ||
| 109 | + ExpiresByType image/jpeg "access plus 1 year" | ||
| 110 | + ExpiresByType image/png "access plus 1 year" | ||
| 111 | + ExpiresByType image/jpg "access plus 1 year" | ||
| 112 | + ExpiresByType image/x-icon "access 1 year" | ||
| 113 | + ExpiresByType application/x-shockwave-flash "access 1 year" | ||
| 114 | + </IfModule> | ||
| 115 | +<IfModule mod_deflate.c> | ||
| 116 | +AddOutputFilterByType DEFLATE text/plain | ||
| 117 | +AddOutputFilterByType DEFLATE text/html | ||
| 118 | +AddOutputFilterByType DEFLATE text/xml | ||
| 119 | +AddOutputFilterByType DEFLATE text/css | ||
| 120 | +AddOutputFilterByType DEFLATE application/xml | ||
| 121 | +AddOutputFilterByType DEFLATE application/xhtml+xml | ||
| 122 | +AddOutputFilterByType DEFLATE application/rss+xml | ||
| 123 | +AddOutputFilterByType DEFLATE application/javascript | ||
| 124 | +AddOutputFilterByType DEFLATE application/x-javascript | ||
| 125 | +BrowserMatch ^Mozilla/4 gzip-only-text/html | ||
| 126 | +BrowserMatch ^Mozilla/4\.0[678] no-gzip | ||
| 127 | +BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | ||
| 128 | +Header append Vary User-Agent | ||
| 129 | +RewriteEngine On | ||
| 130 | +AddEncoding gzip .gz | ||
| 131 | +RewriteCond %{HTTP:Accept-encoding} gzip | ||
| 132 | +RewriteCond %{REQUEST_FILENAME}.gz -f | ||
| 133 | +RewriteRule ^(.*)$ $1.gz [QSA,L] | ||
| 134 | +</IfModule> | ||
| 135 | + Cache-Control | ||
| 136 | +<ifModule mod_headers.c> | ||
| 137 | +# 30 дней | ||
| 138 | + <filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> | ||
| 139 | + Header set Cache-Control "max-age=2592000, public" | ||
| 140 | + </filesMatch> | ||
| 141 | + # 30 дней | ||
| 142 | + <filesMatch "\.(css|js)$"> | ||
| 143 | + Header set Cache-Control "max-age=2592000, public" | ||
| 144 | + </filesMatch> | ||
| 145 | + # 2 дня | ||
| 146 | + <filesMatch "\.(xml|txt)$"> | ||
| 147 | + Header set Cache-Control "max-age=172800, public, must-revalidate" | ||
| 148 | + </filesMatch> | ||
| 149 | + # 1 день | ||
| 150 | + <filesMatch "\.(html|htm|php)$"> | ||
| 151 | + Header set Cache-Control "max-age=172800, private, must-revalidate" | ||
| 152 | + </filesMatch> | ||
| 153 | +</ifModule> | ||
| 154 | 154 | ||
| 155 | #Запрет отдачи HTTP-заголовков Vary браузерам семейства MSIE | 155 | #Запрет отдачи HTTP-заголовков Vary браузерам семейства MSIE | 
| 156 | -#<IfModule mod_setenvif.c> | ||
| 157 | -#BrowserMatch "MSIE" force-no-vary | ||
| 158 | -#BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary | ||
| 159 | -#</IfModule> | 156 | +<IfModule mod_setenvif.c> | 
| 157 | +BrowserMatch "MSIE" force-no-vary | ||
| 158 | +BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary | ||
| 159 | +</IfModule> |