next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Encode revalidateTag value fixes #61390

Open OMikkel opened this issue 2 years ago • 0 comments

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

OMikkel avatar Jan 30 '24 14:01 OMikkel