cache: add delayed degenerate path handling
(cherry picked from commit 6f19dc2124a31aadf419743288d2ec1abd895563)