Giter VIP home page Giter VIP logo

Comments (3)

creeperyang avatar creeperyang commented on September 17, 2024

具体的关于优化的知识点或问题

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.

duduGao avatar duduGao commented on September 17, 2024

good

from blog.

maskhb avatar maskhb commented on September 17, 2024

学习了,感谢翻译 有些翻译还是比较生硬啊

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.