There are a lot of answers out there for browser caching but most are about either turning caching on or off or requesting using a different url for some static asset like js or images.
- I am loading json data over an ajax request
- This is dynamic content, say a list of tasks
- I only want to update when a user has done a certain action. Until then it can be cached forever.
When the user takes that action, I want to invalidate the cache and get a new version from the server.
Is there a way to clear the browsers local cache without changing the url. So, /tasks is cached until next year. I want to invalidate that and force future requests to /tasks to get new data and a new expires header.
Would I be better off not allowing browser caching and cache the requests/data on the server instead?
Another similar question: Forcing AJAX request to revalidate cache with server, without reloading completely