【问题标题】:Keep-Alive doesn't allow all persistent connectionsKeep-Alive 不允许所有持久连接
【发布时间】:2014-08-04 16:15:37
【问题描述】:

我想加快我的网站速度。我在http://www.webpagetest.org/ 网站上进行了测试,检查网站的性能和优化。

我在 .htaccess 文件中启用了 Keep-Alive。问题是测试结果表明只有 18% 的连接是允许的(那些通过 google 链接或包含的连接)

截图:

有人可以向我解释如何允许所有连接吗?

我使用的代码:

<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# Default directive
ExpiresDefault "access plus 1 month"

# My favicon
ExpiresByType image/x-icon "access plus 1 year”

# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# CSS
ExpiresByType text/css "access 1 month”

# Javascript
ExpiresByType application/javascript "access plus 1 year"

</IfModule>
<IfModule mod_headers.c>
  <FilesMatch ".(js|css|xml|gz|html)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
</IfModule>
<IFModule mod_deflate.c>
<filesmatch "\.(js|css|html|jpg|png|php)$">
SetOutputFilter DEFLATE
</filesmatch>
</IFModule>
<IfModule mod_headers.c>
Header set Connection keep-alive

</IfModule>

【问题讨论】:

    标签: apache .htaccess keep-alive


    【解决方案1】:

    在您的 Apache 配置文件中启用 KeepAlive 配置

    KeepAlive On
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-02
      • 1970-01-01
      • 2019-12-03
      • 2017-02-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多