WIP: Implementing caching for widgets.

#6043