Skip to main content
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded.

Creating a cache manifest for offline use

Creating a cache manifest for offline use

To enable users to continue interacting with mobile apps and documents even when their network connection is unavailable, you can provide a cache manifest that lists the files needed for the mobile app to work offline. The cache manifest is a simple text file defined using an HTML rule form named pyCustomAppCache. Each line in the cache manifest refers to a single static resource such as an HTML file, an image file, a CSS file, a font file, or a JS file.

Resources listed in the cache manifest constitute all static resources needed by a mobile app to run offline. You can use the app while a device is offline if the device has the resource cache.

Note: The cache manifest is different from the application rules cache created when you enable offline support for an access group. The application rules cache includes common application rules used by all the operators in the access group. The cache manifest is a list of resource files referenced in the application rules.

To define the cache manifest, save a copy of the pyCustomAppCache record to your application ruleset.

Caution: Do not change the context of your copy of pyCustomAppCache. The record must be applied to Data-Portal.

Working from a clean mobile app, run the app through an HTTP proxy. Work through all the screens that are displayed and look for any HTTP requests.

Tip: Use your browser development tools to identify each of the resource files in the DOM.

Add requested resources to the cache manifest so that if the user only logs in and goes to the portal page but then goes offline, all static resources are correctly cached.

Cache manifest syntax

To add a resource file to the cache manifest record, add each resource file on a separate line.

Tip: To add a comment to the cache manifest, start the line with the # (octothorp) character.

If the name of the requested resource file uses a series of numbers in the src attribute such as webwb/filename_1234567890.xxx!!.xxx, use the <pega:binaryfile> element with the name and app attributes.

If the name of the requested resource file includes capital letters, use the keepCase attribute with a value of true. The keepCase attribute ensures that a case-sensitive name is read correctly. Otherwise, the name is assumed to be lowercase.

For example, upon inspecting the HTTP request in the Document Object Model (DOM), the requested resource is displayed, in part, as <img src="https://academy.pega.com/webwb/Custom-Logo_1662150348.svg%21%21.svg">. Add the resource file to the cache manifest using the <pega:binaryfile> element with the name, app, and keepCase attributes:

<pega:binaryfile  name="Custom-Logo.svg" app="webwb" keepCase="true" />.

Note: The value you specify in the app attribute is the value specified in the App Name (Directory) field of the binary file record in Pega Platform. In the DOM, this value is the nnnn/ string preceding the file name.

If the name of the requested resource file is prefaced with an additional directory, preface the <pega:binaryfile> element in the cache manifest with the name of the additional directory.

For example, upon inspecting the HTTP request in the DOM, the requested resource is displayed, in part, as <img src="https://academy.pega.com/webwb/webwb/Custom-Logo.svg">. Add the resource file to the cache manifest using the <pega:binaryfile> element prefaced with webwb/:

webwb/<pega:binaryfile name="Custom-Logo.svg" app="webwb" keepCase="true" />.

If the name of the requested resource file is the name of the resource file, enter the path and name of the file as displayed in the DOM. For example, upon inspecting the HTTP request in the DOM, the requested resource is displayed, in part, as <img src="https://academy.pega.com/webwb/Custom-Logo.svg">. Add the resource file to the cache manifest using:

webwb/Custom-Logo.svg.


This Topic is available in the following Module:

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice