Fix handling of paths to cached pages