Manage CORS issue with fetch and domain change

Not sure but when I look through the network panel, I can see this:

fetch 301 Moved Permanently (from disk cache)

Also, I can see a loop of redirect like this:

  1. myapi.com > 301 redirect to myapi.org (cache redirect because not define anymore)
  2. myapi.org > 301 redirect to myapi.com (normal because of the new redirect)
  3. myapi.com > 301 redirect to myapi.org (cache redirect because not define anymore)
  4. myapi.org > 301 redirect to myapi.com (normal because of the new redirect)
  5. And so on till the server return an error of Too many redirects

Also, when I add the parameter cache: 'no-cache' in the fetch method in the app, I don’t have the issue anymore but in my case I prefer (if possible) fixing it from the server to avoid sending a new version of the app wait the validation etc.

So, I suppose this is about the browser cache but yes, I never encounter a similar issue previously :confused:

Kind regards,
Loïc