API Reference > imodeljs-frontend > Views > ViewportDecorator > useCachedDecorations useCachedDecorations Readonly useCachedDecorations: undefined | "true" Override to enable cached decorations for this decorator. By default, a decorator is asked to recreate its decorations from scratch via its ViewportDecorator.decorate method whenever the viewport's decorations are invalidated. Decorations become invalidated for a variety of reasons, including when the scene changes and when the mouse moves. Most decorators care only about when the scene changes, and may create decorations that are too expensive to recreate on every mouse motion. If useCachedDecorations is true, then the viewport will cache the most-recently-created decorations for this decorator, and only invoke its ViewportDecorator.decorate method if it has no cached decorations for it. The cached decorations are discarded: Whenever the scene changes; and When the decorator explicitly requests it via Viewport.invalidateCachedDecorations or ViewManager.invalidateCachedDecorationsAllViews. The decorator should invoke the latter when the criteria governing its decorations change. Defined in core/frontend/src/Viewport.ts Line 82 Last Updated: 11 June, 2024