为了减少客户端对服务端资源的请求可以开启mod_expiresso模块
在apache%C%E%D%C/" target="_blank">apache配置文件中去掉这段
“#LoadModule expires_module modules/mod_expiresso
”前面的#号
Httpdconf配置
代码如下
ExpiresActive on
#缓存天
ExpiresBytype text/css "access plus days
ExpiresByType application/xjavascript "access plus days "
ExpiresByType image/jpeg "access plus days "
Expiresbytype image/gif "access plus days "
加入下面内容
代码如下 <IfModule mod_expires
c>
# mod_expires
ExpiresActive on
ExpiresDefault A
ExpiresBytype text/css “access plus
days
ExpiresByType text/javascript “access plus
days ”
ExpiresByType application/x
javascript “access plus
days ”
ExpiresByType application/x
shockwave
flash “access plus
days ”
ExpiresByType image/* “access plus
days ”
ExpiresByType text/html “access plus
days ”
<FilesMatch “
(flv|ico|pdf|avi|mov|ppt|doc|mp
|wmv|wav|jpg|gif)$”>
ExpiresDefault A
</FilesMatch>
</IfModule>
默认缓存时间是天css缓存时间是天