Reply to Re: Baffling! Redirects with header() takes minutes to respond.

Your name:

Reply:


Posted by Andy Hassall on 11/16/05 21:52

On 15 Nov 2005 18:35:06 -0800, "Monty" <monty3@hotmail.com> wrote:

>The PHP version on my server is part of the standard Red Hat Linux ES
>3.0 bundle, and is updated by RedHat, so, while the version may be
>4.3.2, it has all the fixes and security updates already applied by
>RedHat Up2date.

Ah. Fair enough.

>None of the things you mention as a possible cause for this are
>relevant, actually, because the fix is to add an "exit;" after a
>header. Once I do that, it works as it used to. If the cause was
>something else, I presume adding an exit would make no difference, but
>it does.

I'm suggesting that some of your code that is running after the header() call
that is taking a significant time.

Adding exit immediately after header() prevents that code running.

For a trivial example:

<?php
header("Location: http://www.php.net/");
sleep(10);
?>

This takes 10 seconds to actually redirect. So the code that runs after
header() is significant. exit skips it. If it worked before, then surely it is
a possible cause that the code used to run quickly so you didn't notice, but
now it runs slowly.

So, what is running after the header call?
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация