Several changes to the cache module to improve its usability

如果val的值小于0允许吗？