rsnext/packages
Zack Tanner 7051d25519
docs: update revalidatePath & fix cache debug logic (#65365)
When revalidating a page that corresponds with a dynamic path and when
using the “type” parameter, eg `revalidatePath(“/dynamic/1”, “page”)`
corresponding with `/dynamic/[id]`, the wrong cache tags would be
checked to determine if a revalidation occurred.

This is because the “derived” cache tags created for a
`/dynamic/[id]/page` are:

- /dynamic/[id]/layout
- /dynamic/[id]/page

Additionally, a tag is added for the current canonical URL, so the final
tag would be:
- /dynamic/1

Thus a fetch on `/dynamic/1` would be tagged with the following:
- /layout
- /dynamic/layout
- /dynamic/[id]/layout
- /dynamic/[id]/page
- /dynamic/1

Calling `revalidatePath(“/dynamic/1”, “page”)` would signal to
revalidate caches tagged `/dynamic/1/page` in the current logic.
However, this tag doesn’t exist given the above, so it would be a no-op
and wouldn't properly re-invoke the fetch.

This updates the docs to explicitly call out that if you are attempting
to revalidate a path that corresponds with a dynamic page, that you
should not provide a "type" argument.

Fixes #62071
Closes NEXT-3302
2024-05-06 21:35:19 +00:00
..
create-next-app v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
eslint-config-next v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
eslint-plugin-next fix: replace deprecated/removed functions in eslint-plugin-next (#64251) 2024-05-06 14:22:18 -07:00
font v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next docs: update revalidatePath & fix cache debug logic (#65365) 2024-05-06 21:35:19 +00:00
next-bundle-analyzer v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-codemod v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-env v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-mdx v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-plugin-storybook v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-polyfill-module v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-polyfill-nomodule v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
next-swc [PPR] Enable incremental adoption (#63847) 2024-05-06 14:55:00 -06:00
react-refresh-utils v14.3.0-canary.42 2024-05-06 18:36:15 +00:00
third-parties v14.3.0-canary.42 2024-05-06 18:36:15 +00:00