apache设置mod_expires

| |
[不指定 2009/05/13 11:41 | by real ]
首先要确认apache已经加载了mod_expires
在配置文件中,或者 .htaccess(要支持.htaccess)中加入

引用
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 hours"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
</IfModule>

ExpiresActive On 表示开启expires模块
设置图片类 如 gif jpg jpeg png 过期时间为一个月。一般情况下网站上的图片很少修改的,设置的过期时间再长一些也关系不大
设置其它内容过期时间为1小时,比如css js html等
详见 Apache Module mod_expires
Tags:
Apache | 评论(0) | 引用(0) | 阅读(863)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 请输入左侧的字母,不区分大小写