Why you need Persistent Connection for SEO?
It's no secret that page speed is a Google ranking factor - when you look at your website's performance waterfall chart using one of the page speed testing tools, you can see that when you get a site from a server with Connection: close, every resource is loaded over a new connection (the orange bar in the waterfall chart), which adds more time to your page load time.
While on a persistent connection, the server can send subsequent requests from that server over the same connection. This eliminates the need to connect again, thus saving time and loading the page much faster.
So persistent connection -> fewer re-connections to server -> faster page load -> better SEO.
How do you check if your website is using Persistent Connection?
You can easily check if your website supports Persistent Connection by following these steps:
How do you enable Persistent Connection?
You can enable Persistent Connection by sending a Connection: keep-alive HTTP response from the server. Depending on what server powers your website there are a few different ways to go about enabling Persistent Connection. Here are the instructions for:
Difference between HTTP Persistent Connection vs HTTP keep-alive
Keep-alive is the value of the Connection header that is used to indicate that the server supports persistent connection.
In the world of SEO, when you hear that the server does not support HTTP persistent connection or HTTP keep-alive it usually means the same thing. Some people might also call it HTTP connection reuse.
This image illustrates the difference between the client/server connection when persistent connection is enabled and disabled.
Does your server support Persistent Connection?
The default HTTP 1.0 connection is usually closed after each request has been completed, meaning that the server closes the TCP connection after delivering the response. In order to keep the connection open for multiple requests, the keep-alive connection header can be used. In HTTP 1.1 connection is open by default unless the server or client explicitly sets it to close. In HTTP 2 connection is always open. The Connection: close header is ignored on HTTP 2.0
Here is a table outlining if the client server connection is a persistent connection.
HTTP REQUEST/RESPONSE | HTTP 1.0 | HTTP 1.1 | HTTP 2 |
---|---|---|---|
REQUEST Connection: close RESPONSE Connection: close |
Disabled | Disabled | Enabled |
REQUEST Connection: close RESPONSE Connection: keep-alive |
Disabled | Disabled | Enabled |
REQUEST Connection: keep-alive RESPONSE Connection: close |
Disabled | Disabled | Enabled |
REQUEST Connection: keep-alive RESPONSE Connection: keep-alive |
Enabled | Enabled | Enabled |
REQUEST Connection: not
set RESPONSE Connection: close |
Disabled | Disabled | Enabled |
REQUEST Connection: not
set RESPONSE Connection: keep-alive |
Enabled | Enabled | Enabled |
REQUEST Connection: close RESPONSE Connection: not set | Disabled | Disabled | Enabled |
REQUEST Connection: keep-alive RESPONSE Connection: not set | Enabled | Enabled | Enabled |
REQUEST Connection: not
set RESPONSE Connection: not set | Disabled | Enabled | Enabled |
How to enable Connection: Keep-Alive using .htaccess on Apache Servers?
Enabling Connection: keep-alive through the httpd.conf file is the preferred method for Apache servers, but if you are on shared hosting you probably wouldn't have access to the httpd.conf file. Instead, try enabling Persistent Connection using the .htaccess file.
Follow these steps to enable Persistent Connection:
Step by step instruction to enable Persistent Connection using .htaccess on Apache Servers.
How to enable Persistent Connection using httpd.conf on Apache Servers?
In most cases Keep-alive should be enabled automatically if you are using HTTP 1.1 or above. To enable Connection: Keep-Alive all you have to do is edit your Apache config file. It is usually found at /etc/httpd/conf/httpd.conf
There are three settings you can modify here:
NOTE: Web server will usually have a concurrency limit or scalability problem, and when they hit that limit, performance will drop. Keep in mind there are no one-size-fits-all numbers for MaxKeepAliveRequests and KeepAliveTimeout, so speak to you hosting provider OR Webmaster to see what numbers work best for you.
Step by step instruction to enable Persistent Connection using httpd.conf on Apache Servers.
How to enable Connection: Keep-Alive on NGINX Servers?
On NGINX Servers Persistent Connection is usually enabled for most modern browsers but it can be disabled for older browsers using the keepalive_disable directive in ngx_http_core_module. If the value is set to msie6, we would advise to leave it as it is BUT if for some reason it's set to be disabled for modern browsers too, have a word with your host / Webmaster to find out why and possibly get it removed. The value none enables keep-alive connections with all browsers.
Step by step instruction to enable Persistent Connection on NGINX Servers.
How to enable Connection: Keep-Alive on LiteSpeed Servers?
Persistent Connection is enabled by default for LiteSpeed Servers, there is no "yes/no" or "on/off" option its server settings. But you can go into LSWS Admin Console -> Server -> Tuning -> Connection section to modify the Max Keep-Alive Requests, Smart Keep-Alive, and Keep-Alive Timeout (secs) settings.
NOTE: Smart Keep-Alive is a feature in LiteSpeed Servers that is useful for high volume websites where Persistent Connection is disabled for HTML files but other assets like CSS, JS, images, etc. will have Persistent Connection enabled. If you don't have a high volume site you could disable the Smart Keep-Alive feature.
Step by step instruction to enable Persistent Connection on LiteSpeed Servers.
How to enable Connection: Keep-Alive on Microsoft IIS Servers?
If you are running a Microsoft IIS Server, you can enable Persistent Connection by:
Check out this page for more info.
Step by step instruction to enable Persistent Connection on IIS Servers.
Thanks for checking out our keep-alive validation SEO tool. We are a Digital Agency specializing in Search Engine Optimisation, AdWords, Web Design and Retargeting. Get in touch with our SEO agency if you think we can help you with your digital marketing campaigns.
Our Online Marketing Tools
and help you achieve online success.
DIGITAL MARKETING FOR ALL OF AUSTRALIA
- SEO AgencyMelbourne
- SEO AgencySydney
- SEO AgencyBrisbane
- SEO AgencyAdelaide
- SEO AgencyPerth
- SEO AgencyCanberra
- SEO AgencyHobart
- SEO AgencyDarwin
- SEO AgencyGold Coast
- We work with all businesses across Australia