feat: added CORS info on cacheTakeover

This commit is contained in:
arthurfiorette 2023-09-03 17:04:24 -03:00
parent 3be8029ebc
commit ddacaceced
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555

View File

@ -127,10 +127,22 @@ Headers included:
- `Pragma: no-cache`
- `Expires: 0`
Learn more at
::: warning
This option will not work on most **CORS** requests, as the browser will throw
`Request header field pragma is not allowed by Access-Control-Allow-Headers in preflight response.`.
When you encounter this error, you need to make sure `Cache-Control`, `Pragma` and
`Expires` headers are included into your server's `Access-Control-Allow-Headers` CORS
configuration.
If you cannot do such thing, you can fallback to disabling this option. Learn more on why
it should be enabled at
[#437](https://github.com/arthurfiorette/axios-cache-interceptor/issues/437#issuecomment-1361262194)
and in this [StackOverflow](https://stackoverflow.com/a/62781874/14681561) answer.
:::
## cache.methods
<Badge text="optional" type="warning"/>