2011-09-30 69 views
8

我目前在我的Apache配置中使用deflate缓存我的CSS,JS和图像。在Apache中使用deflate缓存图像,JS和CSS

这里是我的代码:

AddOutputFilterByType DEFLATE text/plain 
AddOutputFilterByType DEFLATE text/html 

AddOutputFilterByType DEFLATE text/xml 
AddOutputFilterByType DEFLATE application/xml 
AddOutputFilterByType DEFLATE application/xhtml+xml 
AddOutputFilterByType DEFLATE application/rss+xml 

AddOutputFilterByType DEFLATE text/css 
AddOutputFilterByType DEFLATE application/javascript 
AddOutputFilterByType DEFLATE application/x-javascript 

现在,当我检查我的头我看到:

Host    www.domain.com 
User-Agent   Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 
Accept    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
Accept-Language  en-us,en;q=0.5 
Accept-Encoding  gzip, deflate 
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Connection   keep-alive 
If-Modified-Since Fri, 30 Sep 2011 01:05:01 GMT 
If-None-Match  "124741af-1c4b9-4ae1136f3f9d0" 
Cache-Control  max-age=0 

一切看起来不错,Accept-Encodinggzip, deflate这是我想要什么,但现在我看到的Cache-Controlmax-age=0

这是否会使用deflate击败缓存的目的?这是否意味着它只缓存了1天,第二天它不会缓存它,否则它将不得不重新加载它?

注意:我的图片很少变化,我的CSS和JS每周更换一次。

回答