Updated purge cache hook