Open tomByrer opened 4 years ago
Good question @tomByrer .
I've added as part of this embed test uploading the same sample file to a KV namespace, and updating the template to load the sample image, one from the KV store, and the other from the binary embedded within the script.
The first load had the most dramatic speed difference, after this, reloading multiple times, for me, the KV hosted image loaded consistently slower than the embedded version.
This would make sense since the embedded version is there in memory ready to read, where as the KV version has to internally go within cloudflares infra, locate and load the item from the store.
For me, the embedded version always loaded the same around ~10-40ms.
The KV version loaded around ~20-400ms slower than that.
Oh wow, thanks so much for your research!
But I'm not sure if the official Worker Sites
uses the KV store, rather they use a permanent cache maybe? But I have seen older Worker scripts that do use KV store, so this would be superior for many use cases.
I found this repo by hunting for updates to my Awesome Cloudflare Workers. Today I also found out about Cloudflare's sites. Can you please comment on how they might contrast &/or compliment each other? I'm mostly looking for technical differences; speed differences, how much memory & execution bounds you can hit for a busy site, etc.
cheers