I am writing an extension for the Chrome browser (and later I hope for a port in Firefox). The extension downloads the configuration file from my server - an XML file through XMLHttpRequest. I find that it downloads the file once, and each subsequent call just seems to use the cached original version of the file. It doesnβt matter if I modify the file on the server.
I read that you can try
xmlhttp.setRequestHeader ('Pragma', 'Cache-Control: no-cache');
and so I did it, but it doesn't seem to make any difference. The only way to get a new file is to delete the browser cache, which obviously is not a solution for my growing users.
This seems like a problem I wouldn't be the first person to deal with, so since thatcacheing rules seem to support this as a policy that cannot be easily avoided, my question is, what is the best design? is there any best practice that i don't know about? Should I push somehow, not pull?
source share