Imperva Cyber Community

Expand all | Collapse all

purge_pattern in API purge cache

  • 1.  purge_pattern in API purge cache

    Posted 13 days ago
    Hello,
    I'm using Imperva Cloud WAF. There is a feature to purge cache using API. But I'm not sure what does purge_pattern parameter means. Can anyone give an example of this parameter?
    The link with information where I read about cache purging is below.
    https://docs.imperva.com/bundle/cloud-application-security/page/api/sites-api.htm#Purge

    #CloudWAF(formerlyIncapsula)

    ------------------------------
    Alexander Martyniuk
    ------------------------------


  • 2.  RE: purge_pattern in API purge cache

    Imperva Employee
    Posted 13 days ago
    Hi Alexander,

    These parameters are the equivalent of what is available in the UI under Websites > (site name) > Cache.

    Imperva Cloud Cache Options


    ------------------------------
    Jaired Anderson
    Principal Consultant
    Imperva
    Tulsa OK
    ------------------------------



  • 3.  RE: purge_pattern in API purge cache

    Posted 13 days ago
    Thank you.

    ------------------------------
    Alexander Martyniuk
    ------------------------------



  • 4.  RE: purge_pattern in API purge cache

    Imperva Employee
    Posted 13 days ago
    Hello Alexander,

    Specifically, the purge_pattern parameter allows you to purge specific resources without purging a site's entire cache. For example, if you had a large number of GIF images that you had modified and wanted to only purge the cached GIFs, you could use an API call along the following lines:

    https://my.incapsula.com/api/prov/v1/sites/cache/purge?api_id=X&api_key=Y&site_id=Z&purge_pattern=.gif$

    This would purge anything that ends with ".gif". Alternatively, if you had a large number of files that began with "example_file", you could do the following:

    https://my.incapsula.com/api/prov/v1/sites/cache/purge?api_id=X&api_key=Y&site_id=Z&purge_pattern=^example_file

    This would purge anything that began with "example file".

    Note that this parameter is also optional - if all you wish to do is simply purge the entire site cache, you can do so by omitting the "purge_pattern" parameter.

    ------------------------------
    Clinton Nicholls III
    ------------------------------