There are two problems when deploying prerendered connect on Cloudflare Worker During Build. The same CMS API endpoints can be called multiple times during the build returning the same data. I have made an internal cache during build time to stop this. Run Time. Sometimes when user refreshes a page with the browser refresh button, the Cloudflare Worker, instead of just delivering the pre-render page, calls the CMS API. This can result in excessive API calls and large database egress. This cannot be solved with a server based cache, as Workers do not persist. I am using KV as the persistent cache. This is cleared a part of build process. However, it is not available for use during build process. So first time the Cloudflare Worker calls a prerendered API endpoint, it collects the data and puts it in the KV. Thereafter it collects data from KV.
Which problem does#14860 solve. The first is easy to solve oneself, but would be better if SvelteKit did it automatically. The second seems a design issue with SvelteKit. I do not understand the need to 'refresh' prerender data. In any case, there should be some way of disabling this behaviour. |