网页前端优化-apache篇

以下配置内容放在 httpd.conf 配置文件最后即可,全局有效.

1.设置静态文件的有效期

ExpiresActive On

<FilesMatch “\.(gif|jpg|png|js|css)$”>
ExpiresDefault “access plus 10 years”
</FilesMatch>

参考:http://blog.haohtml.com/archives/3728

2.启用gzip压缩

DeflateBufferSize 8096
DeflateCompressionLevel 1
DeflateMemLevel 9
DeflateWindowSize 15

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
DeflateFilterNote ratio
LogFormat ‘”%r” %{outstream}n/%{instream}n (%{ratio}n%%)’ deflate
CustomLog logs/deflate.log deflate

<Location />
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml
</Location>

参考:http://blog.haohtml.com/archives/3327,注意上面的日志路径要正确

3.配置ETags减少Web应用带宽和负载

FileETag none

参考:http://blog.haohtml.com/archives/3731

4.使用不同的域名提高网页效率-优化网站性能(yslow)

参考:http://blog.haohtml.com/archives/3739

 

 

 


10 thoughts on “网页前端优化-apache篇

  1. Pingback: naltrexone purchase online

  2. Pingback: chloroquine price uk

  3. Pingback: guaranteed ppc

  4. Pingback: How To Use Wealthy Affiliate 2020

  5. Pingback: replica hublot classic fusion haute joaillerie one million

  6. Pingback: buy viagra overnight delivery

  7. Pingback: buy cheap viagra internet

  8. Pingback: faux most expensive rolex

  9. Pingback: เงินกู้ สุรินทร์

  10. Pingback: Jay

Leave a Reply