3 ms·
> I love how your content is automatically replicated to all of their datacenters Well, it feels like it's automatically replicated, but your KV content is usu
by judge2020 6y ago
> I love how your content is automatically replicated to all of their datacenters
Well, it feels like it's automatically replicated, but your KV content is usually only stored in a few select datacenters until it becomes popular (and is then available on all DCs). This process is usually fairly quick (<50ms for a 10mb file, based on my testing from about a year ago) so it's almost imperceivable.
https://developers.cloudflare.com/workers/learning/how-kv-works https://developers.cloudflare.com/workers/learning/how-kv-wo...
> It is optimized for these high-read applications, only reaching its full performance when data is being frequently read. Very infrequently read values are stored centrally, while more popular values are maintained in all of our data centers around the world.
- gazelleeatslion 6y agoExactly. Little more clarification here though I think... Flexibility of Cloudflare KV reads in general still yield quick enough results and make doing a quick and dirty cache a pretty good use case IMHO. But Worker Sites specifically also use the Cloudflare Worker Cache runtime API — aka, per each POP, first reads of a route (index.html, blah.css, cat.jpg) are from KV and THEN cached indefinitely cutting that time to like 10ms. This is taken then even further by using ETAG matching to make BrowserTTL indefinite (304s not 200s) on all assets until cleared cutting repeat visitors (regardless of POP) to basically nothing. Though .html for some reason doesn’t respect this (I think...). Which to me is a GREAT deal! Cache Object: https://developers.cloudflare.com/workers/runtime-apis/cache https://developers.cloudflare.com/workers/runtime-apis/cache Asset Mapper: https://github.com/cloudflare/kv-asset-handler/blob/master/src/index.ts https://github.com/cloudflare/kv-asset-handler/blob/master/s... Lines 181 and 224
- judge2020 6y agoYou can link to specific lines on GitHub by clicking the line number, then the ellipses, then 'copy permalink' (you can also shift-click to select multiple lines). It also links to the current HEAD commit so the code won't change on you later on.
- gazelleeatslion 6y agoThanks! Was mobile can couldn’t figure out