The problem is not from Windows Azure, the current configuration of the IIS is not set to cache any content. The problem is from the client browser. By default, Mozilla (Firefox) will try to cache any kind of content.
In the production environment this is the desired behavior, but in the development and testing stage this can be a nightmare and when you don’t have keyword “CTRL+F5” is not so easy to be used.
One solution to this problem is to change the cache configuration of the browser of the testing machines. This can be done very easily if you enter in the URL “about:config” and hit enter. A list of configuration parameters will be listed. The next two parameters need to be set to “false”:
network.http.use-cache = false browser.cache.offline.enable = false
Another solution is to set the expiration date of the content from the configuration file. The only thing that we need to do is to add in the configuration file the following node:
This configuration can be made also from ISS and from code. If you want to make this confirmation from code you need to add the following lines of code:
<configuration> <system.webServer> <staticContent> <clientCache cacheControlCustom="public" cacheControlMaxAge="00:30:00" cacheControlMode="UseMaxAge" /> </staticContent> </system.webServer> </configuration>
In the moment when you need to set this setting from the code, something is smelly. Maybe you need to use a static content delivery framework like “Mini Static Content Delivery” from CodePlex. Note, this feature is supported in MVC4.
There are a lot of solutions for this problems and a lot of frameworks. In this case the best thing to do was to disable the cache from the client device (for development purpose).