add cache destroy function and destroy shm cache resources on shutdown