简体   繁体   中英

Keep-Alive doesn't allow all persistent connections

I want to speed up my website. I runned test on http://www.webpagetest.org/ website that checks performance and optimization of website.

I enabled Keep-Alive inside .htaccess file. Problem is that result of testing says that only 18% of all connections are allowed (that ones that are linked or included via google)

ScreenShot:

屏幕截图

Can someone explain to me how to allow all connection?

CODE THAT I USED:

<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配置文件中启用KeepAlive配置

KeepAlive On

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM