how to get cached response while using axios-cache-adapter

Viewed 660

In my vue application, i am using server-side storage through a REST API.Some of the fetched data is rarely changing, so fetching it from the server each time the application loads is unnecessary. So, i am thinking to cache the response for first time and serving the cached response next time onwards.

So, i have checked couple of things and found out 'axios-cache-adaptor'. I have seen the github repo but not able to understand how will i get cached response. I have checked the documentation and code but not properly understood.

I have two questions:

1. how to get cached response and store it in session Storage?

  1. Is there any way to create custom cache adapter like 'axios-cache-adapter'?

I know it might be a real noob question and that there is a good established pattern for this. I need some hands-on tips or pointers to example implementations or explanation on getting cached response from 'axios-cache-adapter' and store it in sessionStorage.

0 Answers
Related