cache with backup logic