Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

输入URL后发生了什么 #2

Closed
imsobear opened this issue Aug 7, 2013 · 0 comments
Closed

输入URL后发生了什么 #2

imsobear opened this issue Aug 7, 2013 · 0 comments

Comments

@imsobear
Copy link
Owner

imsobear commented Aug 7, 2013

  1. 输入 URL
  2. 浏览器查询 DNS
    • 浏览器缓存
    • 系统缓存
    • 路由缓存
    • ISP 的 DNS 缓存
    • 遍历搜索
  3. 浏览器发送 http 请求到服务器
    • 服务器根据请求头中的 user-agent,accept,accept-encoding 判断返回内容
    • 如果有的话,每次请求都会发送 cookie 头,包含了键值对
  4. 服务器返回永久的重定向 301
  5. 浏览器得到重定向地址,重新发送请求
  6. 服务器处理请求
  7. 服务器发送响应
  8. 浏览器渲染:
    • HTML Parsing: DOM Tree;
    • CSS Parsing: 也是渲染成一个树的样子,Style Rules;
    • Rendering Tree:根据DOM Tree 和 解析的CSS构建渲染树,其中不可见的元素是不出现在渲染树中的;
    • Layout and Reflow:页面 layout 的变化都会引起 reflow,颜色等变动引起 repaint;
    • Paint: 调用底层API进行绘制。
  9. 浏览器请求 HTML 中的组件
  10. 后续的 ajax 请求
@ghost ghost assigned imsobear Aug 7, 2013
@imsobear imsobear reopened this Sep 26, 2013
@imsobear imsobear removed the 前端 label Jan 17, 2015
@imsobear imsobear closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant