文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>apache里mod_expires的用法...

apache里mod_expires的用法...

时间:2010-08-10  来源:jiangfeng08

新浪微博http.conf中mod_expires配置

<IfModule mod_expires.c>
    ExpiresActive on

    # <FilesMatch "\/$|index\.shtml$">
    <LocationMatch "\/index\.html$|\/index\.shtml$">
         # ExpiresByType text/html A60
         ExpiresDefault A60  //缓存有效期一分钟
    </LocationMatch>

    <LocationMatch "\/$">
        ExpiresDefault A60
    </LocationMatch>

    <LocationMatch "\/crossdomain.xml">
        ExpiresDefault A86400  //缓存有效期一天=24*60*60
    </LocationMatch>

    <LocationMatch "\/favicon.ico$">
        ExpiresDefault A2592000  //缓存有效期三天=3*24*60*60
    </LocationMatch>

    <LocationMatch "\.js$">
        ExpiresDefault A86400
    </LocationMatch>

    ExpiresByType image/gif   A600   //缓存有效期10分钟=10*60
    ExpiresByType image/png A600
    ExpiresByType image/jpeg A600
    ExpiresByType audio/mpeg A129600 
    ExpiresByType text/css A86400
    ExpiresByType application/x-shockwave-flash A86400

    ExpiresDefault A120
</IfModule>

或者

< IfModule  mod_expires.c >  

ExpiresActive on 

ExpiresDefault "access plus 12 month" 

ExpiresByType text/html "access plus 12 months" 

ExpiresByType text/css "access plus 12 months"

ExpiresByType image/gif "access plus 12 months" 

ExpiresByType image/jpeg "access plus 12 months" 

ExpiresByType image/jpg "access plus 12 months" 

ExpiresByType image/png "access plus 12 months" 

EXpiresByType application/x-shockwave-flash "access plus 12 months" 

EXpiresByType application/x-javascript      "access plus 12 months" 

ExpiresByType video/x-flv "access plus 12 months" 

</ IfModule >  

相关阅读 更多 +
排行榜 更多 +
胜利女神新的希望小米服手游下载

胜利女神新的希望小米服手游下载

角色扮演 下载
我要当老板伐木工厂游戏下载

我要当老板伐木工厂游戏下载

模拟经营 下载
涡轮螺旋桨最新版下载

涡轮螺旋桨最新版下载

模拟经营 下载