implement configurable cache size limit