react-prerendered-component
react-prerendered-component copied to clipboard
Cacheing with serverless
Have you ever used your LRU cache with a serverless application? How would you send the LRU from the main application to a render lambda?
I would not - I'll keep lambas isolated.
I've found a simple rule to follow - cache speed should be proportional to the process it caches. If you are doing some heavy database request over the network - feel free to store result in the network memcache.
Having in mind time required to render a single component, branch or a whole App - there is no choice - local cache is the only possible option.
So - cold start, cold cache, cold render... everything is cold. And cold start should be a bigger problem than cold cache.
What if I keep my lambdas warm? Would this work? Yeah unless you are using something like getMulti - a remote cache would be way too slow to keep up with the render. I saw this on Rapscallion before I implemented multi key prefetching
Also, lambda vs kubernetes? I’m kind of new to serverless tech. Coming from Universal, RFR, and kubernetes clusters - Its presented something challenges. Within the react SSR context, what’s your opinion
Cache (I mean normally) data, and use templates (ie cache templates in the local) to make the process more efficient. Bonus: no cache invalidation problem - it's gone with the every deployment.