Ask HN: Cache Invalidation API in browsers?
There are a boatload of APIs being introduced in browsers. But it would be so nice if there were a Cache Invalidation Javascript API, something like:
document.cache.invalidate(some URL pattern);
This should not immediately clear the browser cache (because it will result in stalling of rendering) - but it should simply mark the specific URLs as stale in the browser's cache. They should then be freshly fetched from the server when we request them the next time. This will result in true client-side caching and invalidation, without having to use any reverse proxies or URL hacks. This way, I can even serve all my Content pages as Cache forever, and simply invalidate them whenever there is a change in content or layout!
Could anyone explain why there is no work being done to improve client-side cache invalidation? Are there any limitations which prevent this from being done?
Edit: Typos and minor grammar