fixes #61390 ### What? Added encodeURIComponent to encode revalidateTag value beforing appending it to the url. ### Why? If a tag contains special characters the tag wont be revalidated because the special characters arent encoded. By encoding the tag any special characters can be used. Check out issue #61390 for further explanation I believe this is the reason why users report the revalidateTag as unreliable. They might be using special characters in their tags to make sure they are unique, but when deployed to vercel and the fetch cache is used revalidateTag fail to revalidate them. ### How? By encoding revalidateTag with encodeURIcomponent the tag can contain special characters. Closes NEXT- Fixes #61390 --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
This commit is contained in:
parent
b44b7ebe35
commit
6d5cacad6e
1 changed files with 3 additions and 1 deletions
|
@ -124,7 +124,9 @@ export default class FetchCache implements CacheHandler {
|
|||
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${tag}`,
|
||||
`${
|
||||
this.cacheEndpoint
|
||||
}/v1/suspense-cache/revalidate?tags=${encodeURIComponent(tag)}`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: this.headers,
|
||||
|
|
Loading…
Reference in a new issue