Eric Burel @ericburel.tech · Mar 5

This works ok for values that are shared across requests However, I don't think there is an equivalent to React "cache" function, which is scoped to the current user request. So keep in mind this pattern works for shared values: theme, i18n tokens, sitemap, but not for user-specific values.

0 likes 1 replies

?

Replies

Eric Burel · Mar 5

Update: it seems that using middleware + Astro.locals, I could simplify my code for shared values, but also support user-specific values scoped to the current requests like with React "cache" function