KV and Images differ quite a bit so I will do a comparison of them which should help you decide (note: Pricing is based on the paid Workers plan Bundled):
- Pre-pay for storage ($5 per 100,000 images)
- $1 per 100,000 served
- 10 million Worker calls a month included then $0.5/m after
- 1GB storage included then $0.5/GB
- 10 million reads included then $0.5/million
- You can define sizing for images (variants) to make sure you’re reducing bandwidth.
- It will try to serve more modern formats when it can (like WebP and AVIF).
- If you pay for Imae Resizing then you can dynamically resize through a Worker
- Can only store images up to 10MB
- Does not support AVIF or JXL uploads
- Only 20 variants can be created
- Can only store images up to 25MB
- No image resizing available without the Image Resizing product (or maybe through Rust)
- You’d need to upload all different image formats and try to serve the right one yourself (if you wanted better formats like AVIF)
Images: Images using tiered caching, a high chance for images to be in the cache if you have an alright number of image hits
KV: You can utilize the Cache API in an attempt to keep the images in cache for as long as possible but the cache API and KV cache are only in that colo (not globally!)
A Worker using KV or Images can both be great for this. If you don’t have a lot of images and aren’t getting a lot of hits then Workers will be the cheaper option. If you do get a lot of image hits, Images may be cheaper (though I haven’t done the math). At the very least though, Images provides a much nicer way to upload and handle images.
I wouldn’t say either is better, it just depends on what you need. KV also can store any file which is super nice for a general storage (R2 may be better suited though when released).