Purges content from the CDN using a Regular Expression. See About for details.
NOTE: File removal can take up to 10min.
Path arguments: |
|
---|---|
Responses: |
|
Path arguments: |
|
---|---|
Responses: |
|
The Expression field accepts a limited regex so purge of multiple files is allowed. The expression is limited because it only accepts the following characters:
* . ? $ +
So for example, no grouping is allowed.
The purge algorithm will use the expression passed and match it agains the full content of the given zone and delete all content that it matches.
We use internally a search matching algorithm. This means if a expression is set as simple as jpg instead of .*jpg all content that contains jpg. An example of a wrong and corrent expression for deleting files ending in jpg:
WRONG
expression: 'jpg'
why: It matches all content that contains the 'jpg' in it (the same as *jpg*)
matches:'my_file.jpg', 'folder_with_jpg_and_gif/my_image.gif', 'jpgs_are_not_here/', etc...
WRONG
expression: '.*jpg'
why: It matches all content who has 'jpg' preceeded by anything
matches: 'my_file.jpg', 'folder_with_jpg_and_gif/my_image.gif', etc...
CORRECT
expression: 'jpg$'
why: It matches all content ending in 'jpg'
matches: 'my_file.jpg'
So setting the expression correctly is essencial to avoid purging uneeded content. The same applies to directory purging, setting the full path of the directory is essential to avoid deleting other files who could share the same name as the directory (Check example 5)
Lets assume rule 23 has a CNAME: my.zone.com
Example 1, removing all files terminanting in jpg through wildcard use:
DELETE /content/purge/1234567890/23/.*.jpg
Resolves as: my.zone.com/*.jpg
Example 2, removing a single file:
DELETE /content/purge/1234567890/23/this_image.jpg
Resolves as: my.zone.com/this_image.jpg
Example 3, removing a single file in a specific directory:
DELETE /content/purge/1234567890/23/my_dir/another_dir/this_image.jpg
Resolves as: my.zone.com/my_dir/another_dir/this_image.jpg
Example 4, removing all content:
DELETE /content/purge/1234567890/23/.*
Resolves as: my.zone.com/my_directory/*
Example 5, removing all content from a specific directory:
DELETE /content/purge/1234567890/23/my_directory/.*
Resolves as: my.zone.com/my_directory/*
The response ID is only usefull for tracing. In case of a Purge error, contact us and indicate the ID from the response.
© Copyright 2014, LeaseWeb CDN