-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSR support #1
Comments
I haven't looked in to that before on Cloudflare workers. What would it look like? :) |
Originally done by lukeed, this can give you an idea: https://github.com/lukeed/svelte-ssr-worker/blob/master/src/index.ssr.js I'd personally consider using Cloudflare Workers' built in HTMLRewriter API instead of the string .replace() calls. wtcross built on it further to integrate with Worker Sites: https://github.com/wtcross/svelte-ssr-cloudflare-worker-site But I think he only set up SSR for the index page, and rest is usual html files with Worker Sites? Please don't assume I know what I'm talking about, just asking and suggesting so I may be saying stupid things below I think it could be improved by both integrating TypeScript, using the HTMLRewriter api, adding SSR routing to all pages (not a SPA at this point) and maybe somehow detecting that a page is static and caching it in Workers? I'm very curious about the possibilities of merging Svelte and Cloudflare Workers, I'm sure more optimizations could be done by hooking into the Svelte compiler during SSR and cache some intermediate outputs in Cloudflare's KV and other caches, but I'm not familiar enough with Svelte intrinscs for that. Just dreaming big :) |
I see your template does not currently support SSR on the edge. Is this something you have considered?
The text was updated successfully, but these errors were encountered: