Remove expired caches in middleware