如何解决Laravel 5.2中的Leverage浏览器缓存问题

时间:2016-08-26 23:07:17

标签: php apache laravel-5.2 browser-cache cache-control

我正在使用php laravel框架。 我试图解决利用浏览器缓存。但它仍然显示

enter image description here

在我的.htaccess

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpg "access 5 minutes"
  ExpiresByType image/jpeg "access 5 minutes"
  ExpiresByType image/gif "access 5 minutes"
  ExpiresByType image/png "access 5 minutes"
  ExpiresByType text/css "access 2 minutes"
  ExpiresByType text/html "access 2 minutes"
  ExpiresByType application/pdf "access 2 minutes"
  ExpiresByType text/x-javascript "access 2 minutes"
  ExpiresByType application/x-shockwave-flash "access 2 minutes"
  ExpiresByType image/x-icon "access 5 minutes"
  ExpiresDefault "access 2 minutes"
</IfModule>


<IfModule mod_headers.c>
  <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$">
  Header set Cache-Control "max-age=60, public"
  </filesmatch>
  <filesmatch "\.(html|htm)$">
  Header set Cache-Control "max-age=60, private, must-revalidate"
  </filesmatch>
  <filesmatch "\.(pdf)$">
  Header set Cache-Control "max-age=60, public"
  </filesmatch>
  <filesmatch "\.(js)$">
  Header set Cache-Control "max-age=90, private"
  </filesmatch>
</IfModule>

在我的apache中 mod_rewrite &amp; mod_headers 已启用

enter image description here

更新

我已将缓存时间设置为1周。不到一周不能正常工作。

我该如何解决?

0 个答案:

没有答案