So it seem like in next.config.js
our previous devs coded some pernament redirects like so:
{
source: '/some-path',
destination: 'https://storage.googleapis.com/company/some-path.html',
permanent: true
}
Here's doc: https://nextjs.org/docs/api-reference/next.config.js/redirects
Now we would like to disable that redirect, and use normal page thats generated within next.js app.
I've removed the redirect from next.config.js, but since it used "permament
" param it seems like the redirect is cached in browser (if user visited that redirect previously they'll have to clear cache to actually see the new page, since it uses response code 308 Permament Redirect
).
I've found two possible solutions:
- change the url we're using so the cache wont trigger redirect
- set redirect on that external site back to our page (seems like dirty solution)
Is there other way to fix this? Or maybe default next.js redirect cache has some validation time and it will be fine in few days or something?
You can go to network tab in inspect element and enable "Disable cache". Then refresh the page. Now you can disable the "Disable cache". This is the screenshot for the reference.