Newer Version Available
Caching Policy
LWR sites make heavy use of caching to improve performance and scalability on the live
site. Except for the initial document request and data API calls, all requests required to load a
page are HTTP cacheable.
When the site is published, the JavaScript resources are generated and persisted, and then served at runtime as static, immutable, and cacheable resources.
Any resource is publicly cacheable, provided it’s accessible through a public page in the site. If Experience Cloud CDN is enabled, publicly cacheable resources are cached in the CDN to further improve performance.
See Set Up the Experience Cloud CDN in Salesforce Help.
This table provides more detailed information about caching time to live (TTL) values.
| Resource | HTTP Caching Policy | Description |
|---|---|---|
| Generated framework scripts, views, and components | 150 days | The site’s framework scripts, views, and components are generated and persisted when the site is published. If its contents change, the resource URL changes, which wipes the cache when the site is republished. |
| Permissions | 5 minutes | Permissions scoped modules (@salesforce/userPermission/ and @salesforce/customPermission/) aren’t included in the HTML. Instead, they’re fetched as separate resources. These resources are cacheable for 5 minutes on a per-user basis. |
| Org assets | 1 day | Requests to Salesforce static resources (@salesforce/staticResource/) and content assets (@salesforce/contentAsset/) have max-age cache headers set to 1 day. |