I want a way when a user requests a payload collection, a hook will fetch the API and retrieve the JSON data. This data will be stored in collection in JSON format. The next time user requests the same payload collection, our collection will return the cached data instead of fetching the API again, providing faster response times.
However, we also want that the data is up-to-date, so in the background, it will still fetch the API to get the latest data, even though the cached data is being returned to the user. How can I do that???