Use filter instead of listcomp when checking for stale cache entries