Clear caches in context to prevent memory leakage