(no title)
Elzear | 2 years ago
I will try adding things you mentioned, and I'd love to find way to also have stupidly complex/convoluted storage systems, inspired by tom7's harder drives: https://www.youtube.com/watch?v=JcJSW7Rprio
Elzear | 2 years ago
I will try adding things you mentioned, and I'd love to find way to also have stupidly complex/convoluted storage systems, inspired by tom7's harder drives: https://www.youtube.com/watch?v=JcJSW7Rprio
quickthrower2|2 years ago
Firstly there is an external product feed API that returns JSON.
In a single file I have an async function fetch from it and do some transformations.
In various pages (and I am using the new App Router so this might be different) I just call the function from an async React component and then use that data to do server-side generation.
The catch is that it is limited to 2Mb calls for caching. Otherwise the fetch works but they don't cache it. I am going to experiment to see if I can just store the data in memory globally.
This may not be a great approach for data provided by users. And it is a cache, so the data can be lost of course. Since in my case I can go back to the API it is of no concern.