CDN basics
Cloudimage caching and invalidation
Last updated
Cloudimage caching and invalidation
Last updated
Copyright © 2023 Scaleflex
Cloudimage leverages Content Delivery Networks to accelerate the delivery of your images worldwide. We work with multiple CDN providers to optimise the delivery of your images and provide superb reliability.
In addition to accelerating your images, the CDN provides DDoS (Distributed Denial of Service) protection, which will act as a shield to your servers and avoid any downtime.
CDNs usually cache images for as long as the images are requested by end users. If you want to update an original image, you have two ways of doing so in the CDN cache.
To refresh your images, you can either update the Cloudimage URL or invalidate them to flush them from the resizing servers and the CDN.
Old image:
//doc.cloudimg.io/sample.li/flat.jpg?w=500
New image:
//doc.cloudimg.io/sample.li/flat.jpg?w=500&vh=xx (whereas 'x' represent random numbers)
The vh=xx
will force the CDN to handle sample.li/flat.jpg?w=500&vh=xx as a new image version and update it's cache.
If you cannot change the image URLs when changing the origin image, you can still invalidate (flush) the image from the Cloudimage admin console. Log in to the console and navigate to Invalidation:
Do not use the full path of your image but only the /origin_image_url?operation&filter part as invalidation path. For example, to invalidate //doc.cloudimg.io/sample.li/flat1.jpg?w=500, you need to input /sample.li/flat1.jpg?w=500.
This will remove the image(s) from all CDN nodes and Cloudimage resizing servers.
The invalidation field assumes you are listing v7 Cloudimage paths. If you want to invalidate v6 Cloudimage URLs, you need to check the Use v6 API option
.
Alternatively, the Invalidation API allows to invalidate images via API.