Cleaning up derivations

If I delete an image, the derivations remain in the storage. Is there a way to delete the orphaned derivations somehow?

See the “Deleting derivatives” section from the derivation_endpoint docs.

Hi @janko,

I checked the storage and it looks like Shrine is not even creating new files for the derivatives in the storage, so it seems there is nothing to delete? Am I missing something? The images are transformed OK. I’m using vips, but I don’t think that makes any difference for that.

Thanks!

Uhm, I am not specifying an upload_location nor setting up upload: true for the derivation_endpoint. Is guess that is the reason? It’s actually good that it doesn’t store the derivatives since I just cache them indefinitely with Cloudflare.

Yeah, I’ve assumed you’re asking because you’ve turned on uploading of derivations. The derivation_endpoint doesn’t upload the processed files by default, because it’d be an unnecessary overhead if you already have a reliable CDN.

Wonderful, thanks for the confirmation! I think this is perfect. I have configured Cloudflare for aggressive caching for the CDN domain so it’s better if I don’t waste storage space. Thanks!