I’ll introduce how to prevent Chrome browser from caching 301 redirects.
The problem occurred in the shortened URL feature of a web service, following these steps:
As described in the above articles, clear the browser cache.
If it meets your requirements, you can avoid browser cache by using 302 or 307 instead of 301.
For example, even if you specify HTTP headers like
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Chrome is designed to cache the browser response. The reason is as quoted below:
Note that HTTP 301 is Moved Permanently so caching the response is perfectly allowed. If you don't want the response to be cached, try 302 or 307. en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection - WikipediaRef: web development - How can I make Chrome stop caching redirects? - Super User
301 Moved Permanently is an HTTP response status code that indicates a permanent redirect, so it’s not suitable for cases where the redirect destination may change. In such cases, you should use 302 Found or 307 Temporary Redirect, which indicate temporary changes.
That’s all from the Gemba.