tbranyen / github-viewer

GitHub Viewer.
MIT License
366 stars 59 forks source link

Use RequireJS Text plugin to load templates. #4

Closed robedge closed 12 years ago

robedge commented 12 years ago

Updated the namespace to use the Require Text plugin for loading templates.

tbranyen commented 12 years ago

What's the benefit here over $.get?

robedge commented 12 years ago

I was reusing templates on several different areas of my app. i noticed that there were multiple requests to the same template. Utilizing require cached the requests so that they were only ever called one time.

tbranyen commented 12 years ago

The Layout Manager plugin caches all templates. Something else must have been different on your end. If you can reproduce a test case showing its not caching templates, please file it here: https://github.com/tbranyen/backbone.layoutmanager