If you need to remove a file from MerlinCDN edge caches before it expires, you can either choose file versioning or invalidate the file from MerlinCDN caches.
If invalidation option is used, the next time a visitor requests the file, MerlinCDN returns to the origin server to get the latest version of the file.
You can use MerlinCDN Management panel or API for cache invalidations.
To manage cache invalidations on MerlinCDN Management Panel:
- Log in to MerlinCDN Management panel
- In the left navigation sidebar click Distributions
- Select the distribution you need to invalidate content from
- Click on Cache Invalidations on the menu (1)
- Click on Create Cache Invalidation button (2)
6. Enter path to invalidate cache
MerlinCDN has 2 types of cache invalidation. Wildcard and Instant Cache Invalidations can be used for different scenarios.
Instant Cache Invalidation
Instant Cache Invalidation used for a single cache object. Compared to Wildcard it is faster but only works for a single object. Cache object path which will be purged must specified in the input area. Example usage:
Since Instant Cache Invalidation is used for a single object it can not be used:
- with inputs like /* or /folder/*
- Cache Based on Selected Request Headers: MerlinCDN creates a new cache object for every value of the selected header thus there will be multiple object for the given path.
- Query String Forwarding and Caching: MerlinCDN creates a new cache object for every value of the query strings thus there will be multiple object for the given path.
Wildcard Cache Invalidation
Wildcard Cache Invalidation used for multiple cache objects. To purge all caches you can enter /* to the input area or you can specify a smaller folder or path. Example usage:
In situations that Instant Cache Invalidation can not be used (stated above in Instant Cache Invalidation) you can use Wildcard Cache Invalidation.