Re: General use of rewrite / redirect

From: Date: Tue, 18 Mar 2008 15:03:52 +0000
Subject: Re: General use of rewrite / redirect
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-271735@lists.php.net to get a copy of this message
Quoting Aschwin Wesselius <aschwin@illuminated.nl>:
Per Jessen wrote:
header(location) mechanisms do come with a very huge disadvantage if you don't use them with caution. Requests are reinitialised, libraries loaded (again), DB connections setup/checked again, session lookups are being done, log write for another request etc. That's quite an impact for just not knowing what to do with flow.
I'm having difficulties following you - a plain 303 redirect to a "Thank you" page shouldn't cause all of that. It's an HTTP reply with the 303 and the new URL, followed by a single URL request from the browser.
OK. I think I know how other people (like you) think about just requesting URL's one after another. If that's not such a performance issue for you, fine.
People like who? Come on we try to help.
A plain 303 redirect mostly isn't just a HTML file, it's another script (or the same script with another action falling through a switch statement, whatever).
A 303 is whatever you make of it.
Point is: why hitting you webserver with multiple requests per user, just after submitting a form or whatever caused the redirect? If you have 2 users per day, that won't hurt. But if you have 30.000 concurrent users a minute, that could be 60.000 requests (besides all the images, stylesheets, javascripts that are being re-requested). Or am I talking nonsense?
True. Why hit your webserver with useless requests. But if you submit a form. There must be a action behind it .. right? So you either reload the page, use header() or some other method. The next page needs to be loaded. And so will CSS, JS, images.
-- Aschwin Wesselius /'What you would like to be done to you, do that to the other....'/


« previous php.general (#271735) next »