[RESOLVED] Using Parent Paths vs Absolute path in header('Location:xxx')
Hi All:
I am currently using all absolute paths in my location headers. I find that my sight experiences "too many connection" messages occasionally. My hosting co says by using absolute paths the server is opening up a new connection with every location header and recommended I switch them to parent paths.
I just wanted to run this by you all before I switch this. Security issues (Linux)? PHP issues?
Well for one, I'm guessing by "paths" you actually mean URLs. To that end, note that using relative URLs (e.g. anything that doesn't begin with the protocol, such as 'http://mysite.com/foo') is not currently allowed (though I've heard that might change in the (near?) future).
For another, it's not the server that's opening any connections at all. It's the client.
Finally, even if you allow Keep-Alive connections, it's unlikely that using an absolute URL will force the browser to close the connection and try to create a new one. I'll add one caveat - I'm assuming that your absolute URLs use the same protocol and hostname as that which the client used to make the initial request. In other words, you aren't redirecting them to www.mysite.com after they first arrived at mysite.com (since the two are separate, unique hostnames and thus deserve to be treated as such).
What's more, even if that really were the case, that doesn't justify (IMHO) why that's the source of the problem. If your hosting company can't handle the shape and/or volume of your website's traffic, it doesn't make much sense that the culprit is that you aren't using an HTTP header in a way that would violate the current HTTP standard (albeit in a way that most modern browsers will still be able to handle).
I agree. If that really were the case it would at worst only double the rate the server opening connections (and apparently leaving them open after the client has gone away - but then there's the "Connection:close" header to deal with the caveat mentioned); after all, the client isn't being sent on a treasure hunt through hundreds of redirects, is it?
Bookmarks