Cache data in Nuxt client-side
up Nuxt ⚐
If getCachedData
returns a nullish value, it refetches. Otherwise it returns the cached data. This means that data can be cached across the lifetime of the application.
You can add a “time to expire” by adding a date in the transform function, and then checking against that date.