File tree 1 file changed +7
-4
lines changed 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -123,10 +123,6 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
123
123
private captureCacheTags ( cacheValue : NetlifyIncrementalCacheValue | null , key : string ) {
124
124
const requestContext = getRequestContext ( )
125
125
126
- if ( ! cacheValue ) {
127
- return
128
- }
129
-
130
126
// Bail if we can't get request context
131
127
if ( ! requestContext ) {
132
128
return
@@ -142,6 +138,13 @@ export class NetlifyCacheHandler implements CacheHandlerForMultipleVersions {
142
138
return
143
139
}
144
140
141
+ // Set cache tags for 404 pages as well so that the content can later be purged
142
+ if ( ! cacheValue ) {
143
+ const cacheTags = [ `_N_T_${ key === '/index' ? '/' : encodeURI ( key ) } ` ]
144
+ requestContext . responseCacheTags = cacheTags
145
+ return
146
+ }
147
+
145
148
if (
146
149
cacheValue . kind === 'PAGE' ||
147
150
cacheValue . kind === 'PAGES' ||
You can’t perform that action at this time.
0 commit comments