caching and compressing