You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Programmatic cache invalidation is now available in ocache (used by Nitro v3) via invalidateCache() and .invalidate():
// On the cached function directlyawaitcachedFn.invalidate(...args);// Or standaloneimport{invalidateCache}from"ocache";awaitinvalidateCache({options: {name: "myHandler",getKey: (id)=>id},args: ["some-id"],});
Activity
pi0 commentedon Mar 19, 2026
Programmatic cache invalidation is now available in ocache (used by Nitro v3) via
invalidateCache()and.invalidate():See unjs/ocache#8