Takes one parameter, the URL to purge from CloudFlare's cache


If the URL string is blank or omitted the value from Req.PathWithParams will be used. Otherwise, the URL provided would typically start with / if the domain name from Setup$ "Cnw.Host" is to be used. Other domain names (such as sub domains in the same ZoneID as Setup$ "Cnw.CF.ZoneID") should use a URL that starts with //. To purge the cache for files in other ZoneIDs, the generic CFApi$ function should be used.

CloudFlare cache URLs are case sensitive. If you serve a file to a client with different case than what your purge the client will not realize the purge, or if you are inconsistent with your file case you will have to clear every variation. This command does not affect the client side (browser) cache.

If the Setup$ "Cnw.CF.Purge" is not set to "y" this command will exit silently. The Setup Table values of "Cnw.CF.Email", Cnw.CF.ZoneID", and "Cnw.CF.Key" must be configured as well. "Cnw.CF.Key" must be set last, after "Cnw.CF.Email" and Cnw.CF.ZoneID".



'Purge the cache of the current page

'Purge the cache of specific files
[New] Name2Purge = CustomFunction
CFPurge Name2Purge
CFPurge "/img/Example.jpg"
CFPurge "//"