Metrics: make the cache use localStorage for persistence