我在我的php项目的.htaccess文件中添加了以下代码。利用浏览器缓存不工作在PHP项目的htaccess
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
但仍然谷歌分析器不标记为已解决。它显示(到期未指定)每个图像,CSS和JS。 我需要做其他事情才能使它工作吗?
Thanx,你能告诉我如何检查我的末端mod_expires,因为我不是服务器管理员。 –
thanx,在启用mod_expires之后,它开始工作,但不能用于.js文件。 .js文件有什么问题吗? –
添加此'ExpiresByType应用程序/ javascript“访问加1个月'' – bast