Resizes the cache to the new maxSize.
maxSize
If the current size exceeds maxSize, evicts entries as needed.
Future<void> resize(int maxSize);