Media optimizer cache invalidation not working
When I first fetch an image via Cloudinary media optimizer URL, I get a 404. This is fine because the image was not available on my server in the first place. After I fixed the issue on my server, I still get a 404 via the Cloudinary URL. I assume this is because the 404 is cached on Cloudinary.
Finally, I tried to invalidate the cache (both via the Media Optimizer API and dashboard). However, I still get a 404 with the Cloudinary URL. The response header contains the following:
x-cld-error |
Resource not found on media source: ....
|
I don't think the cache invalidation is working here as the image is available on the media source and can be accessed directly.
-
Hi, Z Adlan, i'm had the same issue, but i found a trick into the docs, and is very simple; is it only generate the same Cloudinary url and add a "version", version is only the current time into unix format with a letter "v" before; ex: (
v1371750447
), is it very important, and works without problem, I hope I've helped you. this is from Cloudinary docs:The version component is an optional part of Cloudinary delivery URLs that can be added to bypass the CDN cached version and force delivery of the newest asset.
Example image delivery URL without version:
https://res.cloudinary.com/demo/image/upload/sample.jpg
Example image delivery URL with version:
https://res.cloudinary.com/demo/image/upload/v1371750447/sample.jpg
-
Hi there,
Thanks for reaching out. If you are still having issues, could you please open a support ticket directly and share as many details as possible, including the URL of the image returning a 404.
You can open a support ticket here:http://support.cloudinary.com
Kind Regards,
Tia
-
Ok it turns out that cache invalidation is not immediate. Takes more than a few minutes after invalidation until the Cloudinary URL is able to return to correct image. Would be nice if the documentation could call this out.
Thanks Temporary Test for your suggestion. However, that solution is for Programmable Media. Here I'm using Media Optimizer where I don't upload anything to Cloudinary.
Post is closed for comments.
Comments
4 comments