E
E
Eugene Shel2015-12-24 23:25:42
htaccess
Eugene Shel, 2015-12-24 23:25:42

How to cache .htaccess files?

<blockquote>Оптимизирую скорость загрузки сайта через .htaccess

применил:
<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=2592000"
  </FilesMatch>
  #отключаем кэширование
  <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
    Header unset Cache-Control
  </FilesMatch>
</IfModule>

Возникает вопрос как кэшировать внешние файлы:

https://mc.yandex.ru/metrika/advert.gif (60 минут)
https://mc.yandex.ru/metrika/watch.js (60 минут)
http://www.google-analytics.com/analytics.js (2 часа)</blockquote>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-12-24
@buksir911

0) get a job at I G so that it becomes your problem
1) score. Because watch.js analytics.js has already been downloaded to the user from other sites
2) if you can’t calm down, put watch.js analytics.js on your server, set up daily updates with cron and

#кэшировать css, javascript и текстовые файлы
  <FilesMatch "\.(js|css|txt)$">
    Header set Cache-Control "max-age=604800"
  </FilesMatch>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question