Closed mazipan closed 17 hours ago
Hi, I'm interested in contributing for this feature. Do we have any preferences on where the cache should be stored?
Personally, I think browser cache with only-if-cached
and checking the result is enough for this.
Or we could leverage SWR's provider by using localStorage
I do prefer localStorage, but since localStorage doesn't have expiry, you might need to add logic extension to check the expiry time.
Ideally it only store for the same day, since in the next day we will generate new data so client might need to refetch to get the last updated data.
Since the data source is updated in the daily basis, it's unnecessary to always fetch it in every page load.
Consider to cache it with expiry 1 day, so we will refetch in another day.