Skip to main content

Postman clear cache response

Β· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

While Postman doesn't have a single "Clear Cache" button that directly affects API results (as it doesn't cache external API responses), the core issue often lies in two areas that mimic caching: DNS resolution and request state persistence.

πŸ’» Postman "Clear Cache" - Addressing Persistent Results and State​

When Postman seems to return old or stale data even after an external API has changed, the problem is rarely within Postman itself. It's usually one of three things: browser cache interference, persistent DNS, or incorrect request configuration.

1. Browser Cache Interference (Cookies and Headers)​

Postman is primarily a desktop application or an isolated web environment, but it can still be influenced by data saved from prior sessions, particularly Cookies and Authorization Headers. Stale cookies or tokens can cause the server to return cached user-specific data or force a redirect to a login screen, which can be mistaken for Postman caching the result.

Solution: Clearing Local State and Cookies​

To achieve a "clean slate" for a request, you must manage the local state Postman maintains:

  • Delete Cookies: In the Postman desktop app, click the "Cookies" link located right below the "Send" button in the main request tab. This opens the "MANAGE COOKIES" window. Identify the domain that is returning stale data and delete all cookies associated with it.
  • Clear Session Data (Postman Agent): If you are using the Postman Web App with the Desktop Agent, closing and reopening the desktop agent may clear any lingering session or connection data it holds.
  • Environment Variables: If your API endpoint relies on authentication tokens (like a Bearer token or API key) stored in an Environment Variable, ensure that token is refreshed and up-to-date.

2. DNS Resolution Persistence (Client-Side)​

A common reason for receiving stale data or an old endpoint response is that your Operating System (OS) or local network has cached the IP address of the API domain. If the API infrastructure recently switched hosts (e.g., migrated from one server to another), Postman might still be trying to reach the old server until the DNS cache expires.

Solution: Flushing the OS DNS Cache​

Flushing your OS's DNS cache forces your system to look up the domain's new IP address immediately.

Operating SystemCommand to Flush DNS CacheAnnotation
Windowsipconfig /flushdnsMust be run from an Administrator Command Prompt.
macOSsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderRequires administrative privileges (sudo).
Linux (systemd)sudo systemd-resolve --flush-cachesCommand varies depending on the distribution and resolver used (e.g., nscd).

3. Avoiding Server-Side Caching with Headers​

In many cases, the "stale result" is due to the API server or an intermediate proxy/CDN (Content Delivery Network) caching the response, not Postman. You need to instruct the entire network path not to use a cached response for your request.

Solution: Adding Cache Control Headers​

Add the following headers to your request to explicitly tell the server/proxy to return a fresh response:

Header NameHeader ValueDescription
Cache-Controlno-cacheInstructs the server/proxy to validate the cached response with the origin server before serving it.
Pragmano-cacheA header dating back to HTTP/1.0, included for backward compatibility with older proxies/clients.
Expires0Tells the client/proxy that the response is immediately stale (set to zero or an expired date).

Note: While these headers strongly request a fresh response, a misconfigured server or proxy may still override them.


4. Postman State Persistence (Collections and Request Data)​

Postman meticulously saves the state of every request in a Collection. If you are modifying the request body, method, or URL, but the changes aren't "sticking," you may need to ensure the changes are properly saved to the collection.

  • Saving Changes: After making any modification to a request (e.g., editing the URL, adding a new header, or changing the body), ensure you click the "Save" button (or press Ctrl+S / Cmd+S) in the request tab. An orange dot on the tab indicates unsaved changes.
  • Troubleshooting Environment: Always double-check that the correct Environment (visible in the top-right corner) is selected, as a forgotten variable selection often leads to unexpected request behavior.

Sources and Further Reading​

  1. Postman Learning Center - Managing Cookies: https://learning.postman.com/docs/sending-requests/cookies/
  2. Mozilla Developer Network (MDN) - Cache-Control: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
  3. Microsoft Learn - Flush DNS Cache (Windows): https://learn.microsoft.com/en-us/windows-server/networking/technologies/dns/dns-client-resolver-cache