@task_postrun.connect
def clear_request_cache(**kwargs):
 middleware.RequestCache.clear_request_cache()

@ task_postrun . connect def clear_request_cache ( ** kwargs ) : middleware . RequestCache . clear_request_cache ( )
once a celery task completes .