Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用deflate在Apache中缓存图像、JS和CSS_Apache_.htaccess_Caching_Header_Deflate - Fatal编程技术网

使用deflate在Apache中缓存图像、JS和CSS

使用deflate在Apache中缓存图像、JS和CSS,apache,.htaccess,caching,header,deflate,Apache,.htaccess,Caching,Header,Deflate,我目前正在Apache配置中使用deflate缓存CSS、JS和图像 这是我的密码: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE applicatio

我目前正在Apache配置中使用
deflate
缓存CSS、JS和图像

这是我的密码:

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-Encoding
gzip,deflate
这是我想要的,但是现在我看到
缓存控件是
max-age=0

这是否会破坏使用deflate进行缓存的目的?这是否意味着它只缓存1天,第二天就不会缓存它,或者它必须重新加载它


注意:我的图像很少更改,我的CSS和JS每周更改一次。

这是两个独立的事情:mod_deflatemod_expires

以下是一些你会感兴趣的文章:


我喜欢第一个链接,感谢它帮助我理解了差异