2017-01-04 5 views
0

Я добавил ниже код в HTAccessконкретный файл для кэширования левередж браузера

## EXPIRES CACHING ## 
<IfModule mod_expires.c> 
ExpiresActive On 
ExpiresByType image/jpg "access plus 1 year" 
ExpiresByType image/jpeg "access plus 1 year" 
ExpiresByType image/gif "access plus 1 year" 
ExpiresByType image/png "access plus 1 year" 
ExpiresByType text/css "access plus 1 month" 
ExpiresByType application/pdf "access plus 1 month" 
ExpiresByType text/x-javascript "access plus 1 month" 
ExpiresByType application/x-shockwave-flash "access plus 1 month" 
ExpiresByType image/x-icon "access plus 1 year" 
ExpiresDefault "access plus 2 days" 
</IfModule> 
## EXPIRES CACHING ## 

Но до сих пор я получаю некоторые файлы, чтобы добавить для кэширования рычагов браузера.

Могу ли я добавить определенные файлы в .htaccess для использования кэширования браузеров?

ответ

2

Вы не можете.

http://httpd.apache.org/docs/current/mod/mod_expires.html

Модуль Apache mod_expires поддерживает 3 директивы

  • ExpiresActive
  • ExpiresByType
  • ExpiresDefault

Синтаксис ExpiresByType директивы

http://httpd.apache.org/docs/current/mod/mod_expires.html#expiresbytype 
ExpiresByType MIME-type <code>seconds 

или

http://httpd.apache.org/docs/current/mod/mod_expires.html#AltSyn 
ExpiresByType type/encoding "base[plus num type] [num type] ..."