0
我在PHP創建我所有的JS和CSS文件的縮小/ obfusctor/gzip的腳本以.php輸出,但我不能到期,但我已經把這個在我的.htaccess:Expires頭用JavaScript
ExpiresActive On
ExpiresDefault A0
ExpiresByType text/css "access plus 2 hours"
ExpiresByType text/javascript "access plus 2 hours"
ExpiresByType application/x-javascript "access plus 2 hours"
Header append Cache-Control "proxy-revalidate"
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
我想過期所有類型文本/ javascript和文本/ css即使提取器是PHP文件。
我該怎麼做?
Thx!
是的,我把header("Content-Type: text/javascript; charset=UTF-8");
下面是完整的HTTP標頭:
Date: Sat, 20 Nov 2010 19:02:05 GMT
Server: Apache/2.2.11 (Win32) PHP/5.3.0
X-Powered-By: PHP/5.3.0
Content-Encoding: gzip
Last-Modified: Sat, 20 Nov 2010 16:03:24 GMT
Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
Content-Length: 181781
Pragma: no-cache
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: text/javascript; charset=UTF-8
200 OK
您是否正確指定了輸出的MIME媒體類型? – Gumbo 2010-11-20 16:39:45