File tree Expand file tree Collapse file tree
packages/cloudflare/src/api/overrides/tag-cache Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,8 +109,9 @@ export class D1NextModeTagCache implements NextModeTagCache {
109109 // A tag is stale when both its stale and revalidatedAt timestamps are newer than the page.
110110 // revalidatedAt > lastModified ensures the revalidation that set this stale window happened
111111 // after the page was generated, preventing a stale signal from a previous ISR cycle.
112+ const lastModifiedOrNow = lastModified ?? now ;
112113 const isInStaleWindow =
113- stale != null && revalidatedAt > ( lastModified ?? now ) && ( lastModified ?? now ) <= stale ;
114+ stale != null && revalidatedAt > lastModifiedOrNow && lastModifiedOrNow <= stale ;
114115 if ( ! isInStaleWindow ) return false ;
115116 return expire == null || expire > now ;
116117 } ) ;
Original file line number Diff line number Diff line change @@ -195,8 +195,9 @@ class ShardedDOTagCache implements NextModeTagCache {
195195 // A tag is stale when both its stale timestamp and its revalidatedAt are newer than the page.
196196 // revalidatedAt > lastModified ensures the revalidation that set this stale window happened
197197 // after the page was generated, preventing a stale signal from a previous ISR cycle.
198+ const lastModifiedOrNow = lastModified ?? now ;
198199 const isInStaleWindow =
199- stale != null && revalidatedAt > ( lastModified ?? now ) && ( lastModified ?? now ) <= stale ;
200+ stale != null && revalidatedAt > lastModifiedOrNow && lastModifiedOrNow <= stale ;
200201 if ( ! isInStaleWindow ) return false ;
201202 return expire == null || expire > now ;
202203 } ) ;
Original file line number Diff line number Diff line change @@ -184,8 +184,9 @@ export class KVNextModeTagCache implements NextModeTagCache {
184184 // A tag is stale when both its stale timestamp and its revalidatedAt are newer than the page.
185185 // revalidatedAt > lastModified ensures the revalidation that set this stale window happened
186186 // after the page was generated, preventing a stale signal from a previous ISR cycle.
187+ const lastModifiedOrNow = lastModified ?? now ;
187188 const isInStaleWindow =
188- stale != null && getRevalidatedAt ( v ) > ( lastModified ?? now ) && ( lastModified ?? now ) <= stale ;
189+ stale != null && getRevalidatedAt ( v ) > lastModifiedOrNow && lastModifiedOrNow <= stale ;
189190 if ( ! isInStaleWindow ) return false ;
190191 return expire == null || expire > now ;
191192 } ) ;
You can’t perform that action at this time.
0 commit comments