Simplified the code by removingng the _sizeCache object. Now every instance has a size property, and a calcSize method that updates the size property.