March 15, 2014

Disable Browser Cache using IIS

In the previous post, I showed how to disable browser caching of a asp.net page and application using asp.net code. In this article, I will show how to disable caching using IIS. Again, note that, there should be a good enough reason to disable browser caching as it will impact performance for repeat visitors.

To disable caching, I will add the necessary caching directives in the response headers. To start with open IIS, select the site or the virtual directory and then click on “HTTP Response Headers” under IIS subheading.

 image

Then, from the Actions pane, click on Add. A prompt will open up. Type in the values and click OK.

image

Click Add again to enter the Pragma directive.

image

And Add another one for Expires.

image

The Response Headers section should appear like below now.

image

 

That’s it – caching will now be disabled for the application on the browser.

0 comments:

Reference: Shahed Kazi at AspNetify.com