Restructuring persistent cache and improving caching of pipes