MichaelBluejay - 4:15 am on Jan 26, 2013 (gmt 0)
Thanks for the suggestions!
Adding a space after Location: didn't help.
I'd never heard of non-buffering, but I looked it up and added $ (pipe character) = 1; before the print command, after the print command, and before [some long process], but it didn't help.
I'd have no idea how to use gzip or mod deflate (whatever that is). Um, am I supposed to try those to see if they help, or could they have caused the problem had I been using them?
I don't know how to fork a process, but it scares me, and it seems quite inelegant.
I don't understand the question about 301 or 302. The way my app works is, the user goes to send.html which has a form, and the Submit button goes to send.cgi, which grabs the addresses for sending, redirects to sent.html, and then proceeds to actually mail out the newsletter...except that it's actually doing all the sending before redirecting, if I try to redirect to a page that's on the same domain as the send.cgi script.
I did some more testing and I have some more info now. I thought I'd be clever and redirect to a page on a different domain (on the same server), and have an htaccess command on that other domain simply redirect back to the target page on the original domain. Amazingly (to me), that doesn't work either: The address bar switches to the 2nd domain and then to the target page, but I still have to wait for [some long process] to finish before the target page actually loads.
Then I tried redirecting to another page *on a completely different server*, but on the same webhost. Same problem.
It works fine if I redirect to anywhere else, like example.com, Google, NY Times, eBay, Amazon, etc. Only when I print Location: to a page on my same webhost do I have the problem. I guess I have to take it up with my webhost?