Added size limiting to the cache, which can be configured.