views:

44

answers:

2

I have an webapplication which refreshs a table each minute from a xml-file. When I edit the content of the xml-file, the log of the script shows a "304 Not Modified"-Message when it try to get the current file. But the file is edited. If i refresh the xml-file http:/xx.de/test.xml in the browser, the webapplication also shows the edit.

How can i prevent, that the request will be cached?

A: 

If you set the header to:

header(“Pragma: no-cache”);
header(“cache-Control: no-cache, must-revalidate”);
header(“Expires: Mon, 12 Jul 2010 03:00:00 GMT”);

It should force it not to cache, if that's what you're after?

Birk
+1  A: 

Two solutions from me:
1) add unique attribute like time to URL. So it will be like test.xml?x=840234242
2) set approriate headers in requested file.

Māris Kiseļovs