Comments (3)
具体的关于优化的知识点或问题
1. 为什么网页设置缓存后仍然有请求(304响应)?
浏览器刷新是conditional request
,所以如果通过刷新来看缓存是否有效肯定是304。可以试试输入网址按回车或者回退键来看效果。另外由于HTML文档很少设置完全缓存(一般要和服务器验证),可以看静态组件的缓存效果(200 ok (from cache)
)。
2. expirationTime = responseTime + freshnessLifetime - currentAge
freshnessLifetime
具体怎么算可以参考https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching_FAQ。
3. Flash of unstyled content(无样式内容闪烁)
Flash of unstyled content(FOUC)就是在加载外部样式表之前,浏览器按默认样式显示了内容,这是因为浏览器在所有资源都下载好前就开始渲染页面了。一旦外部样式被加载,浏览器就会修正样式,但这种修正可能是可见的,也就是FOUC。
怎么避免?在<head>
中通过<link>
引入样式,避免使用@import
。
from blog.
good
from blog.
学习了,感谢翻译 有些翻译还是比较生硬啊
from blog.
Related Issues (20)
- JavaScript问题集锦(二) HOT 5
- mark
- 怎么用Vue.js改造(大型)传统PHP网站? HOT 12
- wrong
- 学习与理解 React Fiber HOT 3
- Vue源码解析
- 浏览器的工作原理 HOT 2
- 从零开始学习 Android (笔记) HOT 2
- 三元 vs if else HOT 1
- 每周一读(高质量文章/视频浏览记录) HOT 2
- 算法学习(JavaScript实现) HOT 6
- mobx 学习笔记
- 了解 JavaScript 中的事件循环
- 牛逼 HOT 2
- __proto__
- Web性能指标与相关优化
- webpack runtime 源码分析
- webpack 核心概念和优化指南 HOT 2
- 从浏览器关键渲染路径聊起
- 日常问题记录 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.