https://www.youtube.com/shorts/p3yJa_z2BY8
Debug overlay visualisation of widget caching
So when a widget has a green overlay it's drawing a cached version (just a bitmap) of the widget (and any nested widgets). When a widget has a red overlay it's re-drawing to the cached bitmap and then drawing the cached version and when there isn't a green or red overlay it's rendering the widget directly to window surface (or if the parent is cached, directly to the parent cached bitmap).
What's interesting is the layouts mostly resize the widgets constantly but what you see is an even distribution of drawing/blitting cached versions (or re-drawing and blitting cached version) or rendering directly.
The algorithm only uses/creates a cached version when the size is the same from the previous frame (a possible tweek is using the last 2 frames). So the idea is when the size of a widget has changed from the previous frame there's no point rendering to an intermediate buffer and then rendering that, just render directly and only when the size has settled then render to cache and use the cache.