Mar*_*cel 6 apache .htaccess apache2 mod-expires http-headers
我无法弄清楚为什么< 10 KB
我正在处理的网站中的普通旧JPEG图像(大约十几个)不会采用缓存控制标头,而是强制输入..htaccess
我正在使用的规则基于最新的HTML5 Boilerplate .htaccess文件(下面的相关部分).有什么奇怪的是,网站中有大量相同数量的PNG,除了其中两个外,缓存控制标头工作正常.
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
...
# 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"
...
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
Run Code Online (Sandbox Code Playgroud)
(省略号表示ExpiresByType
删除了多余的规则部分)
我已经从我的/etc/apache2/apache2.conf
文件直接到那里包含的几乎所有conf文件,并且找不到合理的解释.我已经摆弄,Pagesped和Chrome审核了几个小时的死亡,我仍然无能为力.
编辑:如下所述,.htaccess
此网站的Web根目录中只有一个文件.JPEG正在通过mime类型image/jpeg
正常,但缓存控制标头丢失,我无法弄清楚为什么.
我添加no-transform
到该mod_headers
部分,果然,它都按预期工作.现在我可以让我的额头从墙上休息一下.
<IfModule mod_headers.c>
Header append Cache-Control "public, no-transform"
</IfModule>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7078 次 |
最近记录: |