Would you like to learn how to disable the cache of files on the user’s browser using the IIS server? In this tutorial, we are going to configure the IIS server to disable the cache of files.

• Windows 2012 R2
• Windows 2016
• Windows 2019

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial IIS – Disable the browser cache

Start the application named: IIS Manager.

Start IIS Windows

On the IIS Manager application, select your website.

On the right part of the screen, access the option named: HTTP Response Headers.

IIS response header

On the top right part of the screen, click on the Set common headers option.

IIS - Set common headers

To disable the cache of files on the user’s browser, perform the following configuration:

• Expire the web content – Yes.
• Immediately – Yes.

Click on the OK button.

IIS - Cache-control No-cache

Optionally, use the command-line to add a custom HTTP header.

Copy to Clipboard

In our example, we configured the CACHE-CONTROL header on the IIS server to inform the user’s browser to not perform the cache of content.

To test the installation, open the Chrome browser on a remote computer and access your website.

In our example, the following URL was entered in the Browser:

• http://18.237.128.221

Use the page inspection feature of the Chrome browser to verify the Headers from your server.

IIS - No-cache header

Optionally, you may use the CURL command of a Linux computer to test the header configuration.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You configured the IIS header named CACHE-CONTROL to not allow the user to cache the content of your website.