Refactor visualizer caching for doc browser.