Skip to main content

Posts

Showing posts from February, 2016

Lazy loading in the HTTP/2 world

Already touched upon this topic in my HTTP/2 write-up (don’t do this without setting up HTTP/2 first), but although I did initial testing back then only got back to it seriously yesterday. So, let met give some very quick instructions on how to get it working in PSK, though likely it will be similar in any other Polymer application. <page-*> elements Start of with making every page an element. In my case these elements are called <page-*> elements, so your index.html looks something like: <iron-pages attr-for-selected="data-route" selected="{{route}}"> <page-welcome data-route="home"></page-welcome> [...] </iron-pages> It’s possible to set this up in different ways as well, but this is the best way I have found so far to organize my application in Polymer. Lazy loading them My approach is to trigger the loading of the elements from the router. This might be somewhat debatable from a logical poi