Changed delete cache implementation
Added a delete cache test