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

feat: Write JSON files on SSR with useStatic #532

@Rigo-m

Description

@Rigo-m

🆒 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions