Напомните пожалуйста, этот блок кода.
На самом деле htaccess указывает параметры для статики (js, css, картинки), а сгенерированный html будет иметь заголовки из самой CMS.
Кстати, если используется nginx, то большая часть правил работать не будет.
Два сайта на одном хостинге. Ответ сервера для первого сайта (Joomla 2.5)
HTTP/1.1 200 OK
Server: nginx/1.4.4
Date: Sun, 14 Sep 2014 04:35:54 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=10
X-Powered-By: PHP/5.3.27-pl0-gentoo
Set-Cookie: 5f35a235ab0c93fb14c1dbf8322305a5=75em8kqpb1m8jctqdv6f1b91r4; path=/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: no-cache, max-age=0, public
Pragma: no-cache
Vary: Accept-Encoding,User-Agent
Expires: Sun, 14 Sep 2014 04:35:49 GMT
Ответ для второго (Joomla 3)
HTTP/1.1 200 OK
Server: nginx/1.4.4
Date: Sun, 14 Sep 2014 04:40:38 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=10
X-Powered-By: PHP/5.3.27-pl0-gentoo
Set-Cookie: af5d5338e0e2a1c3b96ad061b40bedf9=jtej69nmevpa5ipl3bm56fm3j5; path=/; HttpOnly
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Expires: Mon, 1 Jan 2001 00:00:00 GMT
Last-Modified: Sun, 14 Sep 2014 04:40:38 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding,User-Agent
Фрагмент .htaccess (на обоих одинаковый файл):
# ---------------------------------------------------------------------------------------------------------------------
# Expires headers (for better cache control)
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# your document html
ExpiresByType text/html "access plus 0 seconds"
# data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# rss feed
ExpiresByType application/rss+xml "access plus 1 hour"
# favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
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"
# htc files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# css and javascript
ExpiresByType text/css "access plus 2 months"
ExpiresByType application/javascript "access plus 2 months"
ExpiresByType text/javascript "access plus 2 months"
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
# ---------------------------------------------------------------------------------------------------------------------
# ETag removal
FileETag None
В третьей Джумле заголовок Expires прописан вот тут — ..\libraries\joomla\application\web.php (426 строка):
// Expires in the past.
$this->setHeader('Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true);
Денис, подскажите как повлиять на этот заголовок, и вообще, стоит ли на это обращать внимание? Не должно быть такой давней даты?