聚合物:禁用HTML导入缓存 [英] Polymer: Disable HTML Import caching

查看:109
本文介绍了聚合物:禁用HTML导入缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何禁用聚合物开发的HTML导入缓存?

解决方案

HTML导入高速缓存有时候意味着我的自定义HTML Web组件发生了更改。对导入的HTML文件所做的更改不会在刷新浏览器时反映出来。以下面的导入为例:

 < link rel =importhref =./ my-element.html > 

如果对 my-element.html 之后加载页面,则更新的文件可能无法下载并在刷新时用于当前文档(因为它以前导入并缓存)。这对于制作来说可能很好,但可能会阻碍开发。



要在Google Chrome中禁用此功能,请执行以下操作:



这样可以避免缓存HTML Imports,但只有当DevTools处于打开状态时才会缓存。


How do I disable HTML Import caching for Polymer development? Changes made to my custom HTML web component are not being shown when I refresh the browser.

解决方案

HTML Import caching will sometimes mean that changes made to HTML files that get imported do not get reflected upon browser refresh. Take the following import as an example:

<link rel="import" href="./my-element.html">

If a change is done to my-element.html after previously loading the page, then the changed file may not be downloaded and used in the current document when it is refreshed (as it was previously imported and cached). This can be great for a production, but might hinder development.

To disable this in Google Chrome:

This will avoid caching HTML Imports, but only when DevTools is open.

这篇关于聚合物:禁用HTML导入缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆