-
-
Save Elvinz/a9ea5483e1471197dd5770cad2a95f96 to your computer and use it in GitHub Desktop.
Битрикс. Кэширование браузера.
client cache
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
# Включаем кэш в браузерах посетителей | |
<ifModule mod_headers.c> | |
# Все html и htm файлы будут храниться в кэше браузера один день | |
<FilesMatch "\.(html|htm)$"> | |
Header set Cache-Control "max-age=43200" | |
</FilesMatch> | |
# Все css, javascript и текстовые файлы будут храниться в кэше браузера одну неделю | |
<FilesMatch "\.(js|css|txt)$"> | |
Header set Cache-Control "max-age=604800" | |
</FilesMatch> | |
# Все флэш файлы и изображения будут храниться в кэше браузера одну неделю | |
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$"> | |
Header set Cache-Control "max-age=604800" | |
</FilesMatch> | |
# Отключаем кеширование php и других служебных файлов | |
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"> | |
Header unset Cache-Control | |
</FilesMatch> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment