Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

feat: Write JSON files on SSR with useStatic #532

Open
Rigo-m opened this issue Aug 17, 2021 · 0 comments
Open

feat: Write JSON files on SSR with useStatic #532

Rigo-m opened this issue Aug 17, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Rigo-m
Copy link

Rigo-m commented Aug 17, 2021

🆒 Your use case
What if I have a huge website with expensive calls and I can't generate each page (let's say some pages are pre-generated and some are not).
I'd like to be able to leverage useStatic functionality because it can be used both on generated routes and on SSR routes and it all works correctly.

But what if I want to create some sort of ISR leveraging useStatic? I can set a regeneration strategy (time-based or commit-based or whatever) and write the JSON payload of the factory function whenever the cache has been voided or the JSON file isn't there, instead of just running the factory function in the client.

🆕 The solution you'd like
I'd like to have a way to call the factory function in the server from the client so that the JSON gets generated and is available on the next hit to the same page

@Rigo-m Rigo-m added the enhancement New feature or request label Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants