Imperva Cyber Community

communities_1.jpg
 View Only
  • 1.  purge_pattern in API purge cache

    Posted 05-19-2020 08:43
    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

    Posted 05-19-2020 09:24
    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 05-19-2020 09:28
    Thank you.

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



  • 4.  RE: purge_pattern in API purge cache

    Posted 05-19-2020 09:34
    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
    ------------------------------



  • 5.  RE: purge_pattern in API purge cache

    Posted 06-09-2020 14:52
    @Alexander Martyniuk

    You also might be able to find more information here: https://docs.imperva.com/bundle/cloud-application-security/page/settings/caching-settings.htm#Purgethecache 

    The following options are available under Operations:


    ------------------------------
    Christopher Detzel
    Community Manager
    Imperva
    ------------------------------