1 Disconnect your device from the network to test - only works for same origin layers.
This example shows how to use the CacheWrite control to cache tiles that are being viewed in the browser's local storage, and how to use the CacheRead control to use cached tiles when offline or on a slow connection. See offline-storage.js for the source code.