-
-
Notifications
You must be signed in to change notification settings - Fork 780
Open
Labels
Description
Describe the feature
Motivation
I want to let my editor choose when to invalidate the cache after content updates.
Problem
The current implementation sets maxAge, so the file may get's cached by the browser itself.
I have therefor no tool to revoke the browser cache or tell the browser to invalidate the cache.
Caveat
Please correct me if I am wrong or point me to the right direction if I missed something.
Solution
https://github.com/nitrojs/nitro/blob/main/src/runtime/internal/cache.ts#L283
If we would allow custom cacheControl we could customize the behavior as we want.
it could also be a function to be more flexible.
const cacheControl = [];
if (opts.customCacheControl) {
cacheControl.push(opts.customCacheControl)
} else if (opts.swr) {
}
Benefit
I could set customCacheControl to no-store and have always served the cached files until I regenerate them by a webhook call.
Additional information
- Would you be willing to help implement this feature?
Reactions are currently unavailable