Disabling Caching

Many client and server applications cache resources to optimize sequential connections. Caching works through specific HTTP headers that instruct the client or the server to use a local copy of the response. This way, applications can load their content significantly faster than having to download the actual resources each time they are requested.

Whether you are a tester, quality engineer, or developer, you might often need to clear the cache using the built-in tools (for example, through the Empty Cache and Hard Reload feature in Chromium-based browsers) to ensure that you are seeing the latest version of the requested resources.

With Fiddler Everywhere, you can create a rule that automatically disables data caching. This allows you to test always against the latest version of your client/server API.

Creating a "No Caching" Rule

Create a "No Caching" rule by setting the following actions through the Rules Builder.

  • Create an Update Request Header action and remove all pre-set values for the If-Modified-Since header.
  • Create an Update Request Header action, and remove all pre-set values for the If-None-Match header.
  • Create an Update Request Header action and set the Pragma header to no-cache.
  • Create an Update Request Header action and set the Cache-control header to no-cache.
  • Create an Update Response Header action and set the Expires header to 0.
  • Create an Update Response Header action and remove all pre-set values for the Last-Modified header.
  • Create an Update Response Header action and remove all pre-set values for the eTag header.
  • Create a Update Response Header action, and update the Cache-Control header with value no-cache.

This sample Fiddler rule matches all sessions and explicitly turns off the caching through.

Creating "No Caching" rule

The matching criteria in the above screenshot demonstrate how to apply the rule for all sessions. However, Fiddler Everywhere provides robust matching conditions that you can use to further optimize your web debugging process.

Once the rule is created, enable the Rules tab, toggle the rule switch, and start capturing traffic.

Activating the "No Caching" rule

Download a ready-to-use "No Caching" rule as a FARX file, which you can import through the Rules toolbar.

See Also