0

Is there any way to send immediately a response to the client (a waiting page) and continue execution until sending the definitive response?

I'm working with Symfony2 (PHP).

Manolo
  • 24,020
  • 20
  • 85
  • 130
  • It's not possible. Web servers use compression when sending text, so even echoing a string won't be transmitted directly to the browser, but rather the server will wait for the entire message. What you're looking for is the waiting page submitting an ajax request to check the definitive response. – W.B. Jul 18 '14 at 11:49
  • 1
    Not sure what you want to achieve. Sure, there cannot be 2 responses (1 early and 1 "definitive"(?)). Although, you can `ob_end_clean()` and `flush()` which should result in the response is being sent to the client while PHP still executes after it. – marekful Jul 18 '14 at 11:51

1 Answers1

2

Only by adding a refresh meta tag in the html (http://webmaster.iu.edu/tools-and-guides/maintenance/redirect-meta-refresh.phtml) or by using javascript.

Edit: To redirect with javascript see How to redirect to another webpage in JavaScript/jQuery?

Community
  • 1
  • 1
dammkewl
  • 622
  • 5
  • 23
  • I'll try with meta tag because JS will not work if you have disabled it. Any issue with browser compatibility and meta tags? – Manolo Jul 18 '14 at 12:45
  • 1
    Done! And added a link to manually redirect if meta tag doesn't do it (meta redirection can be disabled on the browser). – Manolo Jul 18 '14 at 15:22