我无法获得JS文件的过期头文件正常工作..它工作正常,如CSS文件!头文件失效的javascript文件不能正常工作
有人能告诉我我做错了什么吗? :(
htaccess的
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
在CSS文件头
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
头的JS文件
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
作为测试,htaccess文件中的值是实际显示的在CSS的标题? EG:如果您将A29030400更改为其他内容,您是否看到这反映在服务的CSS标题中? 此外,作为另一个测试,如果你尝试以不同的方式格式化的htaccess会发生什么:< “\(JS)$” filesMatch>'... ExpiresByType文/ CSS A29030400 ExpiresDefault A29030400 ' ? – Tr1stan
添加答案.. reg exp解决方案与filesMatch的作品! :D – clarkk
很高兴帮助,答案补充说。 – Tr1stan