Reputation: 36048
How does the browser determine which files to store in the cache? I will like to implement a feature on my website that checks the internet speed and I will do so by calculating the time it takes to download some small files. The problem is that if these files get stored in the cache then my algorithm will not work. Also if I create a large file with aspx that the only thing that varies in that file is the time, then maybe I should split it in two files so that the part that does not change can be stored in the cache.
Upvotes: 0
Views: 279
Reputation: 111
You should look after HTTP headers HTTP headers. In c# for ASP.net :
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
But perhaps you won't be able to change them (depending on you web hosting service). Then, if a HTML document :
<meta http-equiv="Expires" content="Tue, 01 Jan 2010 00:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
At last, you may simply change the name. Adding a random parameter do the trick most of the time :
..."http://example.org/myresource.extension?time=1213232322"...
Upvotes: 1