Condensed cache cleaning logic