Svelte-Chicago / sveltechi.dev

https://sveltechi.dev
0 stars 1 forks source link

migrate events to store #9

Closed sjsadowski closed 2 years ago

sjsadowski commented 2 years ago

events have two primary issues, one is that the load from firebase is relatively slow causing problems with page hydration, and another is that vercel has no way to cache requests on on the filesystem.

To some extent this is mitigated by using an in-memory cache for the serverless script to reduce round trip times between cache calls, however that is only maintained during the lifetime of the lambda. From cold, the script is noticeably slow. The cache could be prewarmed by having a static cache set as an envvar on vercel and doing a differential update.

This would best be handled by using a custom store instead of a fetch event, which would allow the event data itself to be properly managed by combining the fast load of a static asset that is pregenerated at build time along with a real-time update on page load, continuing to take advantage of the serverless functions.

sjsadowski commented 2 years ago

Superseded by #10