Hey everybody,

I have more than a casual interest in figuring out how to make a "Public 
CDN" of custom elements work. The biggest stumbling block at the moment is 
the inability to deduplicate imports that come from multiple URLs. Here's a 
theoretical system and I'm curious how well you think it would work:

   1. Elements are namespaced to paths like* 
   /some-element/0.1.0/some-element/some-element.html* (that's a lot of 
   some-element, but it's necessary to achieve proper namespacing AFAICT)
   2. Bower dependencies for that component at that version are installed 
   into their own similarly namespaced folders.
   3. 301 redirects are setup to trigger automatically for each dependency 
   pointing to its canonical location in the CDN.

As I understand how the internals work, this would trigger each component 
to be uniquely cached by the browser. Since versioning is included in the 
URL, these could have "forever" Cache-Control headers attached. So long as 
the origin server handling the redirects is reasonably fast, wouldn't this 
allow the user's browser to cache the imports for a published element and 
use it efficiently even when depended on by several other elements?

The only question at that point becomes how to avoid duplicate import for 
locally installed dependencies. Has there been any progress on 
standardizing a way to prevent different-url-same-element imports?

Feedback appreciated, thanks.

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/ca04b71b-277a-4099-ab83-1384e1a95be3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to