frond end 找工作 随笔

What happens when you click on a link and get the web page? meaning what's the process behind that?

anwser:

1. Checks link's URL part. If not empty take that URL to be feteched. 
2. browser checks cache; if requested object is in cache and is fresh, skip to #9 
3. browser asks OS for server's IP address 
4. OS makes a DNS lookup and replies the IP address to the browser 
5. browser opens a TCP connection to server (this step is much more complex with HTTPS) 
6. browser sends the HTTP request through TCP connection 
7. browser receives HTTP response and may close the TCP connection, or reuse it for another request 
8. browser checks if the response is a redirect (3xx result status codes), authorization request (401), error (4xx and 5xx), etc.; these are handled differently from normal responses (2xx) 
9. if cacheable, response is stored in cache 
10. browser decodes response (e.g. if it's gzipped) 
11. browser determines what to do with response (e.g. is it a HTML page, is it an image, is it a sound clip?) 
12. browser renders response, or offers a download dialog for unrecognized types 

There are many other things happening in parallel to this (processing typed-in address, adding page to browser history, displaying progress to user, notifying plugins and extensions, rendering the page while it's downloading, pipelining, connection tracking for keep-alive, etc.).

 

get and post 区别?

(1)get是从服务器上获取数据,post是向服务器传送数据。

(1)   在客户端,Get方式在通过URL提交数据,数据URL可以看到;POST方式,数据放置在HTML HEADER提交。

(2) 对于get方式,服务器端用Request.QueryString获取变量的值,对于post方式,服务器端用Request.Form获取提交的数据。

(2)   GET方式提交的数据最多只能有1024字节,而POST没有此限制

(3)   安全性问题。正如在(1)中提到,使用 Get 的时候,参数会显示在地址栏上,而 Post 不会。所以,如果这些数据是中文数据而且是非敏感数据,那么使用 get;如果用户输入的数据不是中文字符而且包含敏感数据,那么还是使用 post为好。

转载于:https://www.cnblogs.com/leetcode/p/3163293.html

你可能感兴趣的:(frond end 找工作 随笔)