Better path caching