vike
vike copied to clipboard
+data caching
Description
Use cases:
- Avoid re-fetching the +data of layouts, see https://github.com/vikejs/vike/issues/1833#issuecomment-2324900026.
- Avoid re-fetching global +data (e.g.
pages/+data).- Upon client-side navigation.
- Forever cache. (Similar to
+onBootbut different:+datais called lazily upon rendering a page, whereas+onBootis called eagerly upon starting the server/pre-rendering.)
- More use cases?
This would also be very useful for passing data to +Layout if at all possible, think Auth / Profile details for tools such as Firebase
Closing in favor of:
- https://github.com/vikejs/vike/issues/2566