New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add keep-alive-header via .htaccess #1115
Comments
|
I found some similar statements like this one which summarizes the advantages and disadvantages pretty good I think. Maybe it's not useful for everyone to include Keep-Alive by default but to have it as an opt-in. I wonder what the reason for Google Page Speed is to include it as a recommendation; they don't provide further information from what I have seen. |
as discussed in h5bp#1115
this could be enabled for just image/js/css assets maybe? |
You think it's ok to have it turned on for every site that uses HTML5 BP even with the problems mentioned? |
I am strongly in favor of turning on keep-alive, even by default. Here are some key reasons why.
So while there are a few downsides to using keep-alive, I would absolutely recommend using it, as I think its value outweighs its limitations. I don't know enough about what deployments of HTML5 BP look like to be certain about turning it on by default, but I would bias in favor of doing so. |
We can also add a timeout to Keep-Alive, so that the server closes the connection after a certain time. |
I already use keep-alive pretty-much everywhere, though I can imagine this being a surprise for people who weren't expecting this kind of configuration alteration. I think that keep-alive should definitely have a time-out config go with it, if it does go in. |
cc @h5bp/server-configs |
KeepAlive Directive can only be configured in the section at max. Does changing the header 'alone' work completely? And we must make sure its only enabled for 'capable' browsers as some don't work properly with this. |
If you intend add that KeepAlive directive ... it should be wrapped with a IfModule directive. Else it will certainly throw an HTTP500 in case mod_headers is absent on the box. Not that I would be aware of any browsers not supporting it (besides .htaccess can't detect any browsers). So how you suggest to ensure this? I honestly see no way ... this simply isn't PHP so no access to browsecap.ini (if even installed). IE6 must die. |
was any decision made on this ? |
Not yet. This should be on hold until .htaccess is moved to the h5bp/server-configs repo. Please see h5bp/server-configs#59. |
Issue moved to h5bp/server-configs#107 following the migration of development of the |
hey guys i access to .htaccess but when i check my keepalive ( From There ) this tell me your connection is close :| why i cannot enable this from my htaccess file i used this code too
but still does not work |
@thesogafoi 1. Wrong repo. the server configs have their own repos. 2. This is more of a support request than a bug request. Stack Overflow, maybe? |
I stumbled over keep-alive a view times lately while checking Google Page-Speed for some advice for a specific project.
Keep-alive is an HTTP feature which allows the server to send multiple requests through one TCP-connection as far as I understood. This improves performance up to 50% according to the Apache config docu. @getify states in #28 that a connection with keep-alive may be 20-30% faster.
From my experience and this SO question it seems like the HTTP header is set in a server-configuration and you can't change it easily via .htaccess.
Today I found this new answer on the SO question from above which describes that it is possible to use
Header set Connection keep-alive
in the .htaccess to control the behavior of this.This works for me. I've tested this in two projects now, one of them is my blog. The request-header "Connection" is set to "keep-alive" now and Google Page-Speed does not show this anymore as "to be done". Here is a screenshot of the headers.
I'd suggest adding this to the .htaccess file as it seems to improve performance and I've not encountered any problem with setting this header.
Looking forward to your feedback!
The text was updated successfully, but these errors were encountered: