Coder Social home page Coder Social logo

what-happens-when-zh_cn's Issues

关于浏览器缓存没有提及奥

http 200(from cache) 和 304

http://stackoverflow.com/questions/1665082/http-status-code-200-cache-vs-status-code-304

在先前至少有过一次有效访问后,在以后对同一URI资源的请求中,浏览器只进行两种动作:
(1)直接在缓存中去获取内容。如果先前有效访问的响应头包含 Expires, max-age的话,“打开新窗口”、“输入URI回车”、“前一页”、“后一页”这些浏览器行为不会使浏览器在Expires, max-age设置的有效期时间内去访问服务器,而是在缓存中去获取内容,但是’”刷新’”或”重载”例外。
(2)访问服务器,根据服务器响应来获取内容。这种情况发生在设置no-cache等头标要求不缓存,或者是设置了 Expires,max-age但浏览器行为是“刷新”或“重载”时候。’Last-Modified’、’ETag’、’must-revalidate’ 等有些特殊,不直接受浏览器行为影响,它们必须访问服务器后,再由服务器判断是直接发送新的资源,还是发送一个304 Not Modfied让浏览器使用缓存中的资源。

内容来自
http://www.haidx.com/http-304-and-200-from-cache.html

这个翻译的很水

读起来很生涩,像是机器翻译。感觉PO主貌似也不是很懂的样子哦

错别字

HTTP 服务器请求处理 部分

“HTTPD(HTTP Daemon) 在服务器端处理请求/相应”

请求/相应 --> 请求/响应


对了,我能否将文章转载到自己的博客呢?(原文地址和原仓库地址均会注明)

当请求资源时应该会先检查缓存

  • 缓存从网络中读取抵达的请求报文
  • 缓存对保温进行解析并查找本地是否有副本可以用若没有就获取一份(向服务端)并将其保存在本地
  • 如果有副本可以用需要对其新鲜度进行检测(通过Cache-Control和Expires首部),如果足够新鲜直接使用这个副本返回给服务端
  • 如果新鲜度已过需要与服务端进行再验证(常用If-Modified-Since:Data或E-tag首部)如果服务端检查过之后文档未发生变化则返回一个新的过期时间,若发生了变化则返回一个新的资源。

DNS查询的问题

如果本地/ISP DNS 服务器没有找到结果,它会发送一个递归查询请求,一层一层向高层 DNS 服务器做查询,直到查询到起始授权机构,如果找到会把结果返回

这里应该是迭代查询

翻译错误太多 建议去看英文原版

It may even suggest "google.com" before you finish typing it.(翻译错误)
The DNS client establishes a socket to UDP port 53 on the DNS server, using a source port above 1023.(翻译错误)
看了看,发现这几处因为翻译错误比较严重,存在误导性。

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.