Skip to content

Commit de960f4

Browse files
committed
chore: remove previous attempt to set cache tags on 404s
1 parent d96b20c commit de960f4

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/run/handlers/server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export default async (
132132
}
133133

134134
setCacheControlHeaders(response, request, requestContext, nextConfig)
135-
setCacheTagsHeaders(response.headers, request, requestContext)
135+
setCacheTagsHeaders(response.headers, requestContext)
136136
setVaryHeaders(response.headers, request, nextConfig)
137137
setCacheStatusHeader(response.headers, nextCache)
138138

src/run/headers.ts

-7
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ export const setCacheControlHeaders = (
285285

286286
export const setCacheTagsHeaders = (
287287
headers: Headers,
288-
request: Request,
289288
requestContext: RequestContext,
290289
) => {
291290
if (!headers.has('cache-control') && !headers.has('netlify-cdn-cache-control')) {
@@ -294,13 +293,7 @@ export const setCacheTagsHeaders = (
294293

295294
if (requestContext.responseCacheTags) {
296295
headers.set('netlify-cache-tag', requestContext.responseCacheTags.join(','))
297-
return
298296
}
299-
300-
const key = new URL(request.url).pathname
301-
const cacheTag = `_N_T_${key === '/index' ? '/' : encodeURI(key)}`
302-
console.log('setCacheTagsHeaders', 'netlify-cache-tag', key)
303-
headers.set('netlify-cache-tag', cacheTag)
304297
}
305298

306299
/**

0 commit comments

Comments
 (0)