Apache - Google - Leverage browser caching via htaccess
Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2026
Apache - Google - Leverage browser caching via htaccess (Применяем кеширование браузера через htaccess)
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
Для Apache должен быть установлен:
# httpd -M | grep expires expires_module (static)
Добавляем в .htaccess сайта:
<IfModule mod_expires.c>
<filesmatch ".(jpg|jpeg|gif|png|ico|css|js)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
</filesmatch>
</IfModule>
и проверяем тест в Google:
