Juicy / imported-template

Custom element that lets you load template from external file into your document, and take full control over loaded <script>s and <link rel="import">s. Thanks to HTML Imports - caching, script execution, etc. is completely native. Declarative way for client-side includes boosted with HTML Imports features.
http://juicy.github.io/imported-template/examples/index.html
MIT License
28 stars 4 forks source link

Cache imported templates #8

Open tomalec opened 9 years ago

tomalec commented 9 years ago

Currently when another <imported-template> instance for same url is attached to DOM we create new <link> element. Luckyli it does not hit the networking performance, as according to HTML Imports spec it will not download it again, however we just pollute <head>.

We could just keep map of already imported templates, to match url with already processed tempalte, ready to get stamped.

warpech commented 6 years ago

This won't be that much needed if the imported template is cached in a service worker. On the other hand, it is probably needed anyway for https://github.com/Starcounter/RebelsLounge/issues/127.