What is the Static content browser caching policy used by Pega and how does it set the max-age?

We can see under Chrome Developer tools that for different static content request the Cache-Control is having different max-age. For eg. pz_pega_survey_styles.css has max-age as 315360000, whereas one of our custom svg file is having max-age as 604800.

How does pega decides the max-age for any static content and where is it set from?

Is it possible to reduce caching expiry time or remove browser caching?

Cache-Control : max-age.png

@DipjyotiS does the Security documentation Creating a custom HTTP response header help at all?

Also see Static content troubleshooting FAQs

@MarijeSchillern Thank you for your response. The first article doesn’t specify anything about Cache-Control header, but we did try putting it explicitly in Pega-RulesEngine • http/responseHeaders DSS, but it didn’t work.

The second article talks about when does the static content gets invalidated (on save as of the rule-file- type). However, I wanted to know how does Pega apply different max-age for different content (dynamic vs static), is it configurable separately for each types?

@korlk1 @RaviKrishnaChavali would you be able to provide any input here?

@DipjyotiS below is the SME response:

Regarding : What is the Static content browser caching policy used by Pega and how does it set the max-age?

We set max-age in static content request based on with checksum request or static image request.

Example for static content requests,

http://xxx.com/prweb/app/AppAlias_/gFLICWRhd0CfR1wHoXPSp9bRJnkbD80w*/webwb/pzpega_ui_dynamiccontainer_lite_12741129412.js!!.js

http://xxx.com/prweb/datacontent/Image/webwb/DriverLicenseFrontHH20200422T071042.276%20GMT.gif

https://xxx.com/prweb/app/SQUIDDevelopment/t5Fy1LWvTnjnXuogkWpDhQ*/webwb/zblankimage.gif

If static content request with checksum(in above example _12741129412) then max-age we set as 315360000 ms otherwise 604800ms(7 days)

cc @mondp3

@DipjyotiS

Static content is a file generated from from a rule and save to an HTTP server. It is unaffected by user input, application logic or the content of user clipboards. Activity calls fall into this response category.

  • Some rules generate a static content file with a content hash. Files that have a content hash have an extended expiration time. Given the content hash is part of the url the browser will only download a new version of the same resource if the content hasis differrent from what is already contained in the browser cache given caching is based on unique browser path

  • Rule content that generates file that aren’t subject to content hash use a system wide cache timeout. The default ship setting for the system wide setting is 24 hours.

  • Pega doesn’t offer a fine grained settings by file extension type. Automatically changing headers based on some part of the URL, for instance a .xx file extension- is offered by some application servers/plugins or reverse proxy servers.

Additional information is available at Static Content