Polymer HTML Import caching

試著忘記壹切 提交于 2019-12-07 08:19:02

问题


I want to make sure that the browser gets the latest version of my custom elements via HMLT import. Right now, I am attaching a version query string:

e.g.

<link rel="import" href="/dist/elements/my-element.html?v=12345">

This is a common practice for JS and CSS files, and I am wondering if this is valid approach for HTML Imports as well?


回答1:


Yes, the same principles apply.

As an example, take a look at the source of http://www.polymer-project.org/. At the time of this writing, it contains <link rel="import" href="http://www.polymer-project.org/elements/homepage_elements.vulcanized.html?20140828">.

P.S. Described query parameter is not used at http://www.polymer-project.org/ anymore.



来源:https://stackoverflow.com/questions/25431641/polymer-html-import-caching

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!