Skip to content

Instantly share code, notes, and snippets.

@robertito13
Created June 28, 2018 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertito13/192d28ccd2e845b62f1230388d9de63a to your computer and use it in GitHub Desktop.
Save robertito13/192d28ccd2e845b62f1230388d9de63a to your computer and use it in GitHub Desktop.
<?php
if ( !defined( 'ABSPATH' ) ) exit;
function wp_keep_alive($headers, $wp) {
foreach ($headers as $key => $value) {
if ('connection' === strtolower($key)) {
unset($headers[$key]);
}
}
$headers['Connection'] = 'Keep-Alive';
return $headers;
}
add_filter('wp_headers', 'wp_keep_alive', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment