完整性和跨域使样式表在 Chrome 检查器中显示加载两次是否正常?
我正在使用这个:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
删除 integrity 和 crossorigin 属性时,它只会加载一次。 如果不是,为什么会发生?
最佳答案
我找到了一些关于这个问题的信息 here ,如果您还在寻找的话。
The
integrity
attribute for link elements has not yet been implemented and there’s an open spec issue about it. This means the presence of any integrity metadata will currently discard preloaded resources. In the wild, it can also result in duplicate requests where you have to make a trade-off between security and performance.
关于来自具有完整性的 CDN 的 CSS 加载两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42650050/