Situations, when it is needed to clear cache at CDN servers, are
- You have renewed all content or part of content.
- Data is not displayed correctly.
There are 2 ways to clear cache:
- You can use API. Read more on API
- You can do it in the G-CDN control panel in the Purge section.
Сlear cache in the control panel
1. Login to your control panel.
2. Find Purge on the left side of the control panel
3. Choose a CDN Resource which you need to clear cache for.
4. Choose purge method which you would like to use.
In the input line specify the path to the file you want to purge or a path pattern without a domain name.
For purging by pattern use the * operator, which replaces any number of symbols in your path (you can use several * operators in one request). A path must start with the / or the * symbols. Each path must be on a separate line.
If you don’t specify a query string, files with all of the possible query strings will be purged from the cache according to the path pattern.
How to clear cache of selected file: cdn.site/static/image.jpg?
Specify a file path without a domain name: /static/image.jpg.
As a result, all files at cdn.site/static/image.jpg will be purged including files with query string .jpg?VERSION.
If you want to purge only selected file with a query string, specify it in the file path: /static/image.jpg?VERSION.
How to clear cache for the group of files located at cdn.site/static?
Input pattern without domain name and * operator: /statiс/*.
How to clear cache for the group of .jpg files?
Input the * operator and the file name extension .jpg: *.jpg.
As a result, all the jpg files will be purged including files with the query string .jpg?VERSION
How to clear cache for the group of files having /static/ in the path?
Input path pattern without domain name and use * operator twice: */static/*
How to clear cache for the group of .jpg files having /static/ in the path?
Input path pattern with the * operator: */static/*.jpg
Click Purge to start the purging.
Purge Calls Limitations
- You can make 1 purge request per minute.
- One purge request is limited to 50 patterns.
Request for purge will be formed within one minute. Then it will be sent to the CDN servers. Purging time depends on the number of files/paths and usually does not takes longer than 15 minutes.
Use it to purge all files from the CDN servers for a Resource. Choose Purge all files from the CDN Resource and click Purge to start the procedure.
When you purge all files from cache, CDN servers pull these files from the origin that might cause a significant load on your server. If you have a large amount of content, we recommend using our API.