Eugen is a user on You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

I wonder if added a small random image-loading delay for newly-posted images, if it would improve the CDN cache hit rate. As soon as an image is posted, it gets loaded immediately in everyone's browsers, and I imagine a lot of those are CDN cache misses.

Eugen @Gargron

@walfie oo-oh, that's an interesting theory!! but someone's gotta load it from cache first...

· Web · 0 · 0

@Gargron yeah, I guess the users who get the low random delay for that image get to be the ones who prime the CDN cache, and then everyone after that will get the cached version.

I don't actually know how practical that is, but dang, S3 bandwidth is more expensive than I initially imagined. whoops

@walfie @Gargron I was actually thinking earlier that you could just run your own S3-compatible object store from an environment that doesn't charge per gigabyte

@lae @Gargron yeah the production env file suggests minio as an alternative... maybe that would have been a better choice

@walfie @Gargron oh, I didn't realise the guide talked about minio, that's what I was looking at earlier. there's also ceph's rados gateway, which would probably be a better choice for redundancy.

@walfie although - shouldn't the author prime the cache, by loading the uploaded thumbnail and then also with the home feed instant-add? S3 is definitely weird. Make sure to up your cloudflare edge cache from 4h to max

@Gargron @walfie caches are stored/fetched separately between several different regions, aren't they?

@lae @Gargron yeah. maybe I need to stick something between s3 and cloudflare... caching is hard

@Gargron oh hmm, that is probably true. but I guess it would only prime one of the edge caches, and cloudflare has a ton of edge nodes.

yeah I upped the edge cache TTL to 1 month a few days ago and it definitely helped