@leejpsd/nextjs-cache-handler 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1605,7 +1605,10 @@ function extractTagsFromValue(value, ctx) {
1605
1605
  }
1606
1606
  function isTagStateExpired(state, lastModified, isFetch) {
1607
1607
  if (!state || typeof lastModified !== "number") return false;
1608
- if (typeof state.expired === "number" && state.expired >= lastModified) return true;
1608
+ if (typeof state.expired === "number" && state.expired >= lastModified) {
1609
+ if (typeof state.stale !== "number") return true;
1610
+ if (state.expired <= Date.now()) return true;
1611
+ }
1609
1612
  if (isFetch && typeof state.stale === "number" && state.stale >= lastModified) return true;
1610
1613
  return false;
1611
1614
  }