Improved cache path handling