1

The common solution for client caching beyond native Cache-Control caching is tools like Redux, React-Query, etc.

E.g. A scenario where you fetch a list of todos, and now we POST an update a todo #2, and now as a result of the POST response, we update the client cache without refetching the list of todos again.

These tools are client driven - it's up to the client code to define how long data is fresh for, how to update it, etc.

What I'm looking for a tool that will provide the same configurable caching behaviour, but this behaviour is defined in the server. The way this would work is that the server returns custom headers defining the behaviour, and some client tool, wrapping fetch, uses these headers to execute the logic.

The value of such a tool is that caching behaviour can be defined once - on the server, and all clients can get the value of this definition, by using the said fetch wrapper.

Does such a tool exist?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.