O'Reilly logo

Getting Started with Backbone Marionette by Arturo Soto, Raymundo Armendariz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving the performance of the application with TemplateCache

In every application, performance matters. That's why having our templates available in the cache will definitely improve the speed of the rendering process in future calls.

Marionette has an object called TemplateCache that is used by the Renderer object. This means that all of our templates are stored in this TemplateCache object and to start making use of it, we just need to call the get method. Internally, this method will confirm whether it already has the template and then return it; alternatively, it will load the template from DOM and will return the template so that we can use it, but it will also keep a reference of it. Hence in the subsequent call, we will get the cached ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required