Comments (8)
This is honestly waaay above me, we need andras here, excited to learn about it tho
from webstudio.
- How do we connect a some-site.wstd.io to go to Cloudflare worker and then render a specific site?
Workers have wildcard domains so we can point any *.wstd.io
to a worker. Rendering a site is done on the app side.
- How do we connect a user's TLD to Cloudflare worker
Do you mean custom domains, that are not wstd.io
? We can dynamically add or remove custom domains to a worker through HTTP request to CF API.
- Do we need to deploy to a worker for each site or do we have one worker that uses some kind of cache for each site and serves it? If it's later, how do we build such a cache, and where do we store it. It has to have very quick access from the worker.
We can have one worker for all sites. For caching, there are two options:
- CF KV Store -> The only con is that it has 60s TTL.
- CF Durable Objects -> I used it once, does not have so much experience with it, but with this, we can define cache TTL's.
Both are low latency, distributed storage for workers.
There is no other way until CF D1 (CF sqlite) is introduced, which is low-latency and does not require remote HTTP requests.
from webstudio.
Questions with CF APIs:
- How hard would it be to switch to something else (right now I think CF is great, but you can't bet on this for 3+ years ahead)
- How would we build it so that a self-hosted user can publish a site on their own server (whatever that is), assumed they don't want CF or edge
from webstudio.
- How hard would it be to switch to something else (right now I think CF is great, but you can't bet on this for 3+ years ahead)
These features could be easily switchable to a self-hosted/not-worker environment.
- How would we build it so that a self-hosted user can publish a site on their own server (whatever that is), assumed they don't want CF or edge
I suggest having an env variable, something like IS_ON_EDGE
or similar, and we only need to make a small function that decides where the requests should go, which data source (CF KV/durable object store vs. local SQLite).
Wdyt?
from webstudio.
from webstudio.
We can have one worker for all sites. For caching, there are two options:
So this is how it would work?
- worker receives a request from some dns provider
- goes to the durable objects store to fetch the cached data for the project
- If data cache - renders the site with remix and data
- if not found fetches data over API service, renders, puts the data into durable object store
Now
- How fast can it fetch lets say 300KB from store when its cached to start rendering?
- The assumption is that the worker has all the code already ready? I think when in the future user can provide a code component - this won't be easily possible unless the code component will be stored together with the rest of the data in the store
- Wouldn't it be MUCH faster if we were able to deploy each worker individually together with data, so that it doesn't have to fetch from store? (I literally don't know where CF workers store the code that is supposed to run and what is possible to store there)
from webstudio.
I've done a small research on this.
- Tested with 522KB data stored in a KV store. KV responses are between ~18-50ms. (Durable Objects has 130KB size limitations - I was not aware of this)
- Yes, the worker should have all the code. This is just quickly thinking, but maybe we can store the component code in the KV store as well and return on demand? Not sure if could work.
- KV data stored in centralized data centers, and if requested, cached on edge.
About the minimum 60s cache TTL, we can get rid of it, by versioning the data. So like versioning each deployment of a website created in webstudio.
from webstudio.
I think we can close this one in favor of the new 2
from webstudio.
Related Issues (20)
- Render an error in collection when data is not an array
- Support Markdown as Content Embed
- Resolve a duplicate token when pasting
- Make an instance readonly / locked
- Set canonical link
- Image Manager Click on the picture doesn't work as expected
- Use current date by default in time component
- Backgrounds panel issues HOT 2
- Update gpt models we use because openai deprecates those in a few days
- Lets make loading of the builder delightful
- favicon.ico not matching project icon? HOT 2
- Ability to add custom attributes HOT 1
- Native Video Component HOT 1
- Assets don't delete when pressing delete from certain areas HOT 1
- Strange bug when looping through elements and adding to DOM (JavaScript bugs) HOT 9
- Animation name property value adds px unit automatically HOT 1
- Add a redirect option for success state in Webhook Form HOT 1
- Installable marketplace projects
- Install any project using a shared link
- Paste CSS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webstudio.