Caching
JSAR follows the classic Web browser's caching mechanism, which is based on the HTTP caching. The caching mechanism is used to store the resources that have been loaded, so that the next time the same resource is requested, it can be directly read from the cache without re-downloading it, which can improve the loading speed and reduce the network traffic.
What's resources?
The caching in JSAR only works for the resources, which contains the following types:
- Document: The HTML or XSML file.
- Stylesheet: The CSS file.
- Script: The JavaScript or TypeScript file.
- Asset: The image, audio, video, or other binary files.
The above resource will be cached when it is loaded by JSAR, and the cache will be stored in the memory or disk according to the resource type and the cache policy.