apache学习

通过配置APACHE,使得被访问页面在客户端进行缓存,从而实现网页访问速度加快,也节省带宽。

 

按下面方法修改httpd.conf:

 

LoadModule expires_module modules/mod_expires.so

# set expire rule

ExpiresActive On

ExpiresByType text/html A36000
ExpiresByType application/x-javascript A360000
ExpiresByType image/gif A2592000
ExpiresByType application/x-shockwave-flash A2592000
ExpiresDefault A604800

另一种写法:

ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType text/html “access plus 30 minutes”
ExpiresByType text/css “access plus 30 minutes”
ExpiresByType text/js “access plus 30 minutes”
ExpiresByType application/x-javascript “access plus 30 minutes”
ExpiresByType application/x-shockwave-flash “access plus 30 minutes”

详细见:http://blog.sina.com.cn/s/blog_5396f1d10100tbfc.html

你可能感兴趣的:(apache)