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?
@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?
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.