Как усилить кэширование браузера

Добавьте эти правила в файл .htaccess, чтобы уменьшить время загрузки веб-страниц, сохраняя наиболее часто используемые файлы с вашего сайта в вашем браузере посетителей.

<IfModule mod_expires.c>

ExpiresActive on

ExpiresByType text/css "access plus 14 days"

ExpiresByType text/xml "access plus 0 seconds"

ExpiresByType text/javascript "access plus 14 days"

ExpiresByType application/x-javascript "access plus 14 days"

ExpiresByType image/ico "access plus 14 days"

ExpiresByType image/jpg "access plus 14 days"

ExpiresByType image/jpeg "access plus 14 days"

ExpiresByType image/gif "access plus 14 days"

ExpiresByType image/png "access plus 14 days"

ExpiresByType image/svg+xml "access plus 1 month"

ExpiresByType text/html "access plus 14 days"

ExpiresByType video/ogg "access plus 1 month"

ExpiresByType audio/ogg "access plus 1 month"

ExpiresByType video/mp4 "access plus 1 month"

ExpiresByType video/webm "access plus 1 month"

ExpiresByType application/x-font-woff "access plus 1 month"

ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

ExpiresByType application/xml "access plus 0 seconds"

ExpiresByType application/json "access plus 0 seconds"

ExpiresByType application/rss+xml "access plus 1 hour"

ExpiresByType application/atom+xml "access plus 1 hour"

</IfModule>



2016-12-05T12:01:10
Шпаргалка