blog icon indicating copy to clipboard operation
blog copied to clipboard

前端博客,关注基础知识和性能优化。

Results 44 blog issues
Sort by recently updated
recently updated
newest added

现在用Chrome DevTools的Performance Insights可以查看页面的性能表现: ![image](https://user-images.githubusercontent.com/8046480/224740487-8be2fe8b-bbcb-4e3e-b77f-0a8983a41e9e.png) 本文探讨上面涉及到的基础性能指标(可能更多),以及对应的优化方式。 ## 性能指标历史 在Performance等API出现之前,浏览器端和性能相关的有两个时间点: - DOMContentLoaded:当初始的 HTML 文档被完全加载和解析完成之后,DOMContentLoaded 事件被触发,而无需等待图像等等完全加载。通常情况下这个时间点是DOM和CSSOM完成。 - load:在整个页面及所有依赖资源如样式表和图片都已完成加载时触发。它与 [DOMContentLoaded](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/DOMContentLoaded_event) 不同,后者只要页面 DOM 加载完成就触发,无需等待依赖资源的加载。 这两个时间点无法准确全面地描述用户感受的页面性能。我们通常会通过额外的代码来计算得到白屏、首屏时间等。 - 白屏时间:页面请求发出到绘制第一个页面元素的时间。 - 通常认为浏览器开始渲染 `` 或者解析完 `` 的时间是白屏结束的时间点。 ```js //...

article
performance
browser

Bumps [set-value](https://github.com/jonschlinkert/set-value) and [union-value](https://github.com/jonschlinkert/union-value). These dependencies needed to be updated together. Updates `set-value` from 2.0.0 to 2.0.1 Commits bb0f038 2.0.1 cb12f14 ensure only valid keys are used See full diff...

dependencies

Removes [ansi-html](https://github.com/Tjatse/ansi-html). It's no longer used after updating ancestor dependency [webpack-dev-server](https://github.com/webpack/webpack-dev-server). These dependencies need to be updated together. Removes `ansi-html` Updates `webpack-dev-server` from 2.11.2 to 4.11.1 Release notes Sourced from...

dependencies

## 1. Charles等抓包工具替换response失败 1. 描述: `map locale` 功能去拦截接口请求,发现浏览器请求失败(无response)。 2. 原因:因为接口请求跨域,首先会有 preflight(Options)请求,此时这个请求也被`map locale`拦截了,导致preflight失败,从而导致跨域请求失败。 3. 解决:过滤掉 preflight 请求。