local storage and cache optimization