@@ -220,11 +220,15 @@ module.exports = class CacheHandler {
...
@@ -220,11 +220,15 @@ module.exports = class CacheHandler {
// Iterate over all entries in the cache
// Iterate over all entries in the cache
for (let [key, value] of cache) {
for (let [key, value] of cache) {
// If the value'stagsincludethespecifiedtag,deletethisentry
// If the value'stagsincludethespecifiedtag,deletethisentry
if(value.tags.some((tag)=>tags.include(tag))){
if(value.tags.some((tag)=>tags.includes(tag))){
cache.delete(key)
cache.delete(key)
}
}
}
}
}
}
// If you want to have temporary in memory cache for a single request that is reset
// before the next request you can leverage this method
publicresetRequestCache(){}
}
}
```
```
...
@@ -310,50 +314,51 @@ If you want to use `after` on custom infrastructure, check your provider documen
...
@@ -310,50 +314,51 @@ If you want to use `after` on custom infrastructure, check your provider documen
<details id="after-serverless">
<details id="after-serverless">
<summary>Reference: supporting `after` for serverless platforms</summary>
<summary>Reference: supporting `after` for serverless platforms</summary>
Using `after` in a serverless context requires waiting for asynchronous tasks to finish after the response has been sent. In Next.js and Vercel, this is achieved using a primitive called `waitUntil(promise)`, which extends the lifetime of a serverless invocation until all promises passed to [`waitUntil`](https://vercel.com/docs/functions/functions-api-reference#waituntil) have settled.
Using `after` in a serverless context requires waiting for asynchronous tasks to finish after the response has been sent. In Next.js and Vercel, this is achieved using a primitive called `waitUntil(promise)`, which extends the lifetime of a serverless invocation until all promises passed to [`waitUntil`](https://vercel.com/docs/functions/functions-api-reference#waituntil) have settled.
If you want your users to be able to run `after`, you will have to provide your implementation of `waitUntil` that behaves in an analogous way.
If you want your users to be able to run `after`, you will have to provide your implementation of `waitUntil` that behaves in an analogous way.
When `after` is called, Next.js will access `waitUntil` like this:
When `after` is called, Next.js will access `waitUntil` like this: