How to get around caching problems with XMLHttpRequest

I was writing a greasemonkey script which is using XMLHttpRequest to get a page, then post something and again get to see if the change was made. However, Opera (and presumabley firefox as well) caches the result of a get through XMLHttpRequest so the test was returning a false negative. Searching for a workarounf, I found ths site:
from which I quote the idea
I’ve worked around this by inserting a timestamp in the query string of every get request – that way it forces IE to ignore the cache.

it works 🙂

Related posts

Leave a Reply

This blog is kept spam free by WP-SpamFree.