How to: Enable HTTP Keep-Alive in WordPress?

April 1, 2013

We usually enable HTTP keep-alive because it responses to header by keeping the client/server connection open across multiple server requests. The open connection improves the web performance when a client makes multiple server requests for webpage content, because the server can return the content for each request more quickly rather than processing all requests at once. Or if we don’t enable HTTP Keep-Alive, the server got to open a new connection for every single request.

Locate the Code in .htaccess

To enable HTTP keep-alive response header in your WordPress blog all you have to do is to locate the following line codes in your blog’s .htaccess file. Or if you don’t know how to edit .htaccess file in WordPress, click here.

<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>

Make sure you have place the above codes after line #END WordPress. Yep, you did it.

Muhammad Dilawar
Muhammad Dilawar
Muhammad Dilawar is a WordPress developer and technical SEO specialist with over 12 years of experience building, optimizing, and maintaining websites. He specializes in WordPress, Elementor Pro, WooCommerce, server optimization, DNS, SSL, Cloudflare, website security, and performance improvements — work that has generated over $500K in revenue for clients and earned him a Top Rated badge on Upwork (top 10% of freelancers) with a 100% client recommendation rate. Through Softstribe, he shares practical guides, tutorials, and industry insights based on real-world experience helping businesses grow their online presence.
More from Muhammad Dilawar