PHP Redirect Force Update (CTRL + F5)

I have a page with an editable table. I need users to be able to edit this and then post their changes. Everything works well until I redirect them to one page with new content (as for their changes). However, they see the old content.

If I press ctrl + f5 in the browser, they will be updated. I was wondering if there is a way to force this. This is my php code which does not help force update:

header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Pragma: no-cache'); header( 'Location: http://www.bamozir.com/en/mtl-en/recent/general-info/cost#edit' ); 

Eugen Rieck Solution is great for firefox, chrome and safari. But not in IE and Opera. Any idea how to fix this?

+3
redirect php refresh
Dec 20 '11 at 3:26 a.m.
source share
3 answers

What ALWAYS works: Assuming your URL is http: //my.server/my/page? A = b & c = d , are you redirecting to http: //my.server/my/page? A = b & c = d & nocache = 1234567890 with 1234567890 being a large random number

+3
Dec 20 '11 at 15:30
source share

You must install the cache control and expiration on the page that you want to force refresh. By setting this before the redirect, you tell the browser not to cache the page from which you redirect.

+2
Dec 20 2018-11-12T00:
source share

Use this header to use the update:

 Refresh: 0;url=http://www.bamozir.com/en/mtl-en/recent/general-info/cost#edit 

Read more about this topic here: 'Refresh' HTTP header

+2
Dec 20 '11 at 3:29 a.m.
source share



All Articles