2SIMPLE

我们已经回来

deflate/expires/Etag

给apache2装上了这几个东西,其中deflate效果最明显,expires和Etag当然有比没有强,具体能加速多少就不清楚了。

Ubuntu下面添加mod很方便:
a2enmod deflate
a2enmod expires

然后配置一下mod_deflate
vi /etc/apache2/mods_enabled/mod_deflate.conf

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php application/x-javascript text/css
</ifmodule>

再配置mod_expires
vi /etc/apache2/mods_enabled/mod_expires.conf

ExpiresActive on
ExpiresDefault “access plus 10 years”

还有Etag
vi /etc/apache2/httpd.conf

FileETag INode MTime Size

重启apache2
/etc/init.d/apache reload

YSlow测试2SIMPLE,分数提升到了C (78)。

Written by Datou

一月 2nd, 2008 at 11:19 下午

One Response to 'deflate/expires/Etag'

Subscribe to comments with RSS or TrackBack to 'deflate/expires/Etag'.

  1. 到访

    欢迎光临听景777-属于个人的Blog
    访问地址 http://www.boynan.com/2.htm
    联系邮件:tingjing777@gmail.com

    在在

    2008/01/04 03:16

Leave a Reply