You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/run/handlers/tags-handler.cts
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -214,10 +214,30 @@ export function markTagsAsStaleAndPurgeEdgeCache(
214
214
){
215
215
consttags=getCacheTagsFromTagOrTags(tagOrTags)
216
216
217
+
// Next.js is calling classic CacheHandler.revalidateTag and 'use cache' CacheHandler expireTags/updateTags separately
218
+
// this results in duplicate work being done (it doesn't cause problems, but it is inefficient)
219
+
// See https://github.com/vercel/next.js/blob/8cab15c0c947a71eb8606ba29da719a2e121fc88/packages/next/src/server/revalidation-utils.ts#L170-L180
220
+
// Deduping those within context of a single request might catch unrelated invalidations, so instead of using just request context
221
+
// we will check if they happened in same event loop tick as well.
0 commit comments