api/internal/gamification/cache/skin_file_cache library

Classes

CachedAsset
A servable skin file: bytes plus the headers the web view host must send.
SkinFileCache
Disk cache of self-contained skin files, keyed by skin id + version: <cacheRoot>/digia-engage-skins/<safeSkinId>/<version>/index.html.

Constants

skinCacheMaxBytes → const int
Cap for all cached skins: 16 MB.
skinCspHeader → const String
The CSP every skin page carries. In Flutter it is injected as a <meta> tag (webview_flutter has no response-header hook); Android sends it as a response header from shouldInterceptRequest.
skinFileMaxBytes → const int
One self-contained skin (index.html) may hold this many bytes: 3.3 MB.

Functions

safeSkinId(String skinId) → String
Replaces every unsafe path character in a skin id with _, so any backend skin id maps to one safe directory segment.
skinKeyFromUrl(String bundleUrl) → ({String skinId, int version})?
The cache key parsed from a bundle entry URL (.../<skinId>/<version>/index.html). Null when the URL is not an allowed bundle URL (https, or http on the API base origin) the cache can serve.