Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants