Imperva Cyber Community

communities_1.jpg
 View Only
  • 1.  Smart caching mode - non static content

    Posted 06-13-2023 01:58

    What exactly does "static content that was not marked as static" mean? How does Imperva determine a content as something marked as static?


    #ContentDeliveryNetwork

    ------------------------------
    Kumar Krishnamoorthy
    Product Architect
    OpenCities Pty Ltd
    Melbourne VIC
    ------------------------------


  • 2.  RE: Smart caching mode - non static content

    Posted 06-13-2023 09:54
    Edited by Jaired Anderson 06-13-2023 10:02

    Hi Kumar,

    Cache-Control headers determine if an object is static or dynamic based on the directive. (cache / no cache)

    For more information, please see the following topic:



    ------------------------------
    Jaired Anderson
    Imperva
    ------------------------------



  • 3.  RE: Smart caching mode - non static content

    Posted 06-13-2023 20:14

    Hi Jaired,

    To be clear existence of "Cache-Control: public" header with max-age > 0 means, the resource is considered as static. Am I right?

    What if no max-age directive is included?

    Also, what happens if no Cache-Control header is set in the response?

    I am trying to work out what's the appropriate cache directives/headers to use for dynamic pages in our application.



    ------------------------------
    Kumar Krishnamoorthy
    Product Architect
    OpenCities Pty Ltd
    Melbourne VIC
    ------------------------------



  • 4.  RE: Smart caching mode - non static content

    Posted 07-04-2023 22:16

    Hi Kumar! 

    To be clear existence of "Cache-Control: public" header with max-age > 0 means, the resource is considered as static. Am I right?

    > That is correct. 

    What if no max-age directive is included?

    > If no max-age is included, Imperva calculates max-age as follows:

    Max-age= Expires - date

    Also, what happens if no Cache-Control header is set in the response?

    > This resources will then be analyzed by Imperva dynamic profile. The algorithm works as follow: 

    Some resources are cached although they don't have headers that consider them as cacheable. A resource is cacheable if:

    • It is requested by five different IPs within a one-hour window.
    • The same resource was identified in each case (based on a cache key). Smart caching learns how many times the resource was changed due to request structure, rules, or header configuration.

    The decision to cache addition resources is made independently by each Imperva proxy.

    As for the caching duration for these resources,

    Imperva uses the Last-Modified response header in the resource to calculate max-age.

    • The max-age value is set to one hour for each day since the Last Modified date, with a maximum of up to 24 hours.
    • If the resource was modified within the last 24 hours, max-age is determined by the setting defined in the Cloud Security Console Performance Settings page under Caching Mode.

    Hope this helps! 



    ------------------------------
    Tit King Tan
    Imperva Employee
    ------------------------------