cla*_*rkk 6 apache .htaccess header mod-expires
我无法让JS文件上的过期标头正常工作..它可以正常工作,例如CSS文件!?
谁能告诉我我做错了什么?:(
ExpiresActive on
ExpiresDefault A0
ExpiresByType image/gif A29030400
ExpiresByType image/jpeg A29030400
ExpiresByType image/png A29030400
ExpiresByType text/css A29030400
ExpiresByType text/javascript A29030400
ExpiresByType application/x-javascript A29030400
Run Code Online (Sandbox Code Playgroud)
Cache-Control max-age=29030400
Connection Keep-Alive
Date Sun, 14 Oct 2012 12:06:45 GMT
Etag "be-4cbcf2ad48b40"
Expires Sun, 15 Sep 2013 12:06:45 GMT
Keep-Alive timeout=5, max=97
Server Apache/2.4.2 (Win64) PHP/5.4.3
Run Code Online (Sandbox Code Playgroud)
Cache-Control max-age=0
Connection Keep-Alive
Date Sun, 14 Oct 2012 12:06:45 GMT
Etag "1ad-4cc00d069f493"
Expires Sun, 14 Oct 2012 12:06:45 GMT
Keep-Alive timeout=5, max=99
Server Apache/2.4.2 (Win64) PHP/5.4.3
Run Code Online (Sandbox Code Playgroud)
(还不能评论......)我运行以下设置,它的工作原理.
ExpiresByType text/js "access plus 1 years"
ExpiresByType text/javascript "access plus 1 years"
ExpiresByType application/javascript "access plus 1 years"
ExpiresByType application/x-javascript "access plus 1 years"
Run Code Online (Sandbox Code Playgroud)
应该管用
干杯罗宾
尝试一个包裹ExpiresDefault在一个<filesMatch标签,而不是使用ExpiresByType:
<filesMatch "\.(js)$">
ExpiresDefault A29030400
</filesMatch>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10373 次 |
| 最近记录: |