We moved this page to our Documentation Portal. You can find the latest updates here. |
Question
How do I purge CDN URLs with "wildcard/purge a directory"?
Environment
OnApp CDN
Answer
It is not possible to purge URLs with "wildcard/purge a directory", for example, in the following form:
/path/to/file/*.jpg
/path/to/directory/
This is because objects are not stored in the cache in the directory hierarchy. Instead, they are stored with their filenames hashed. In order to find the files matching the wildcard or directory, the entire cache must be searched for matching items. It is a very time-taking operation, therefore it is not supported.
Instead, we recommend adding a version id to your URL query string. In addition to invalidating the edge cache, it also invalidates the browser cache.