tags:

views:

382

answers:

3

I am developing a website that relies much on XML data. The web site has an interface where user can update data. The data provided by user will be updated to the respective XML file. However, the changes is not reflected until after 1 or 2 minutes.

Anyone knows how to force the browser to load the latest XML file immediately?

A: 

You can add a random (or sequential) number to the url that you change with every update.

Bill the Lizard
+1  A: 

Use "Pragma: no-cache" header in HTTP response.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

nicudotro
Yeah, that's probably better.
Bill the Lizard
+1  A: 

This isn't a browser issue, it's an HTTP issue. You appear to be serving dynamic files without specifying that they shouldn't be cached. Use the Cache-Control: no-cache HTTP header to indicate this. Pragma: no-cache is the ancient HTTP 1.0 way, you can include it, but alone it is unlikely to be 100% effective.

Jim