Replies: 1 comment 3 replies
-
Hello! Sure thing but first of all, Vitedge can also run on Vercel/Netlify or any Node.js environment, in case cost is a problem.
Generally I would say an app that runs on CDN nodes should be kept as slim as possible for obvious reasons. So pre-compiling templates could probably be a good benefit but I would suggest to do this once you notice the first problems. Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
Hello,
Could you please help me to understood how Vitedge works exactly inside Cloudflare Workers to evaluate the cost and limits?
When we decide to save the template and props in the cache, is it saved inside KV store or inside CF cache feature ? The cache feature seems to be free of charge (limited storage to 5GB), but in this case it's seems to be only cached in this PoP. If it's inside the KV store, it's cloned to their ~200 PoP around the world in 60s, but this have a cost on each Read/Write/Delete.
If it's KV store, I suppose we always need to paid 1 KV Read operation and if not yet exists, to add 1 KV Write operation ? Or do you save it in multiple keys (eg: one key for template, another key for props) ?
For each page on the website with vitedge, this mean this will cost at minimum 1 Worker request + 1 KV Read request, even for simple static files assets ( .css, .svg, robots.txt ... ) or static .html files ?
Do you believe it's possible to use vitedge only in fallback after Cloudflare Pages ? Pages is limited to 20.000 files, but this permit to save cost when theses files are requested. So, if a route/file isn't found in Pages, to execute the Worker vitedge to generate it on-the-fly.
I've read the Worker have a memory limit of 128MB, so each time we add more plugins/packages to vitedge, this will surely require more and more memory for execute the SSR build, and we also need memory for our own code execution. Do you believe this memory limit could be reach ?
Our idea in that case, is to have an intermediate step, kind of "vitedge generate templates" to run on our dev machines. The .tpl files should be a simple .html with some {{ var }} replacements ( and some {{ if / else }} logic ). Then in the SSR worker, the works require less memory/time, only regex replacements, and may be if the .tpl doesn't exists, then to load the current SSR system to generate the page.
Thanks in advance for your help :)
Beta Was this translation helpful? Give feedback.
All reactions