apache配置,打开缓存

一些图片什么的,没必要每次去下载的,可以再浏览器端缓存起来,在apache下添加如下配置就可以实现。

/user/local/apache/bin/apxs -i -a -c mod_deflate.c

<IfModule mod_expires.c>
ExpiresActive on #开启则下面和类型相关的才会好用
ExpiresDefault "access plus 30 days"                        #所有文档的缓存时间
ExpiresByType text/html "access plus 30 days"
ExpiresByType text/css "access plus 30 days"
ExpiresByType image/gif "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType image/jpg "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
EXpiresByType application/x-shockwave-flash "access plus 30 days"
EXpiresByType application/x-javascript      "access plus 30 days"
ExpiresByType video/x-flv "access plus 30 days"
</IfModule>

你可能感兴趣的:(JavaScript,apache,css,Flash,Access)