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).

2
  • 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. Commented Jul 18, 2014 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. Commented Jul 18, 2014 at 11:51

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

2 Comments

I'll try with meta tag because JS will not work if you have disabled it. Any issue with browser compatibility and meta tags?
Done! And added a link to manually redirect if meta tag doesn't do it (meta redirection can be disabled on the browser).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.