# OpenLayers Offline Storage Example

# Offline Storage Example

mobile, local storage, persistence, cache, html5
Caching viewed tiles
Cache status:
Read from cache [try cache first] [try online first1]
Write to cache

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.