View Full Version : client-pull delay
marain
09-24-2014, 12:35 AM
The header in http://www.njsexcrimes.com/page.php?here=index includes this line:
<meta http-equiv="refresh" content="0;url=http://www.MarainLaw.com/page.php?here=sexual-assault-in-new-jersey" />I want visitors to njsexcrimes.com to be redirected immediately to the specified page in marainlaw.com. The client-pull statement actually works, but only after a delay of several seconds. I am wondering how I might be able to eliminate the delay.
Thank you, as always.
A.
jscheuer1
09-24-2014, 01:58 PM
As far as I know, there's no way way of being certain where that delay arises from, obviously not from the content value of the tag. If the tag is the first tag encountered in the head, it wouldn't be the browser's page parser either, at least probably not.
However, the meta redirect should be avoided whenever possible because not all user agents respond to it, and some can actually turn it off.
Since it is a PHP page that you are redirecting from, why not use a PHP header redirect? To do so, make this the very first thing on the njsexcrimes.com/page.php?here=index page:
<?php
header('Location:http://www.MarainLaw.com/page.php?here=sexual-assault-in-new-jersey');
die();
?>
Then it will be a server side redirect. It might not be any faster, but it will no longer be subject to any delay or negation on the client side.
A mod rewrite could also be used, but that would require an htaccess file or server configuration change.
marain
09-24-2014, 08:25 PM
John, your information is incredibly on point. Thank you.
Follow up questions (no good deed goes unpunished): Do you have any recommendation as to which of the techniques to use: php header versus .htaccess? Would it make any sense to use both? Regardless, I'll implement one or the other, or both, and remove the tag.
Thanks again.
A.
jscheuer1
09-24-2014, 11:46 PM
I honestly don't know. If I had to guess I would think that the PHP header - if it were the first thing in the page being redirected from, would be the most nearly uniform. The other server side methods could be quicker or slower depending upon server load as they require a lookup. But I think the results would vary for any of the server side methods and that whatever would generally slow down one would slow another. If there is a large lookup table, that might have to be read before any on page redirect. If so, one method or the other would be better perhaps only if used exclusively. The only glaring advantage with .htaccess and other mod rewrite methods are that even non-server language pages (like .htm, .html, .js, .css, etc.) can be redirected.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.