December 28th, 2012, 08:50 PM
PHP command to refresh browser once?
What is the PHP command that tell the browser to simply refresh the screen once in order to make sure that the content of that page is truely updated.
December 28th, 2012, 09:21 PM
There isn't one. Refreshing the browser is client side action while PHP is server side.
There are 10 kinds of people in the world. Those that understand binary and those that don't.
December 28th, 2012, 09:31 PM
refreshing the whole page is also a rather ugly way to update data. I hate pages that do this.
Most of the time it isn't even necessary, because people usually don't stay on a single page for hours or something. But if you do think you need it, use AJAX to reload specific parts of the page.
December 29th, 2012, 07:31 PM
December 29th, 2012, 09:27 PM
If you're having caching problems then that's something you should specifically deal with. Out of the box you should be fine so it probably means something was added to instruct browsers to cache pages.
If you have dynamic content on the page that needs to be refreshed... once ... then a meta refresh or AJAX is best.
Otherwise what problem are you trying to solve, and (if it's not obvious) why do you think refreshing the page is the solution?
December 30th, 2012, 03:58 AM
read up on the cache-control headers. http://www.w3.org/Protocols/rfc2616/...4.html#sec14.9
you should be able to set the max-age of the page to something small which will force all (good) caches to revalidate. If you are expecting people to sit on the page for a long time and you want it to refresh, then you should do like everyone above me in this thread has said, and use ajax.
Last edited by sir_drinxalot; December 30th, 2012 at 04:01 AM.