Caching to preserve state