# No Caching

> Strip caching and conditional headers so every request reaches the server and every response is fresh. Exactly which headers Cloak Proxy removes and sets.

Source: https://docs.subcloak.com/cloak-proxy/tools/no-caching/

No Caching removes the headers that let apps and browsers reuse old responses. With it on, requests go to the server for fresh data and responses tell the app not to store them. Use it when you change something on the server, or in a mock, and want to be sure the app sees the change instead of a cached copy or a `304 Not Modified`.

## Turn No Caching on

No Caching has no rules. When it's on, it applies to every request Cloak Proxy can read.

1. Choose **Tools › No Caching** (the checkmark item), or open **Tools › Debugging Tools…**, select **No Caching** and flip its switch to **On**.

   You can also use the **Tools** button in the toolbar, or search for **Turn On No Caching** in [Search Everything](https://docs.subcloak.com/cloak-proxy/inspect/search-and-command-palette/) (<kbd>⇧</kbd> <kbd>⌘</kbd> <kbd>A</kbd>).

2. Make your requests again. Changed requests show a `No Caching` badge in the traffic list, and the **N tools on** count in the bottom bar includes it.

3. Turn it off the same way when you're done.

*[Screenshot: The No Caching tool, switched off, listing the request and response headers it changes. No Caching has a single switch. The page lists what it changes.]*

## What No Caching changes

### Requests

| Header | Change |
|---|---|
| `If-None-Match` | Removed |
| `If-Modified-Since` | Removed |
| `If-Match` | Removed |
| `If-Unmodified-Since` | Removed |
| `If-Range` | Removed |
| `Cache-Control` | Set to `no-cache`, replacing any value the app sent |
| `Pragma` | Set to `no-cache` |

Without the conditional headers, the server can't answer `304 Not Modified` and sends the full response.

### Responses

| Header | Change |
|---|---|
| `ETag` | Removed |
| `Last-Modified` | Removed |
| `Expires` | Removed |
| `Cache-Control` | Set to `no-store, no-cache, must-revalidate`, replacing the server's value |

## How No Caching works with other tools

- Request changes are made after [Map Local](https://docs.subcloak.com/cloak-proxy/tools/map-local/) and [Mock Sets](https://docs.subcloak.com/cloak-proxy/tools/mock-sets/), so they only affect requests that go to a server.
- Response changes are made to every response, including those from Map Local and Mock Sets, before response [scripts](https://docs.subcloak.com/cloak-proxy/tools/scripting/) and the response [breakpoint](https://docs.subcloak.com/cloak-proxy/tools/breakpoint/). A script can set caching headers back if you need it to.

> **Conditional writes lose their protection:**
> Some APIs use `If-Match` or `If-Unmodified-Since` on `PUT`, `PATCH` or `DELETE` to avoid overwriting someone else's change. No Caching removes those headers too, so the server can't check them. Turn it off when you test that behavior.

> **Note:**
> No Caching only changes traffic that goes through Cloak Proxy, and only plain HTTP and HTTPS with [SSL Proxying](https://docs.subcloak.com/cloak-proxy/capture/ssl-proxying/) on. If an app already holds a fresh copy in its own cache, it may not send a request at all. Clear the app's cache once after you turn No Caching on.

## Related

  - [Debugging tools](https://docs.subcloak.com/cloak-proxy/tools/overview/): Every tool and how to turn them on and off.
  - [Insights: performance](https://docs.subcloak.com/cloak-proxy/insights/performance/): Find uncached static files and duplicate requests.
  - [Map Local](https://docs.subcloak.com/cloak-proxy/tools/map-local/): Serve a local response; No Caching keeps the app from caching it.
