Added caching for buffer sizes