Knowledge point (a)

A. Hierarchical network

OSI 7-layer top to bottom are Application Layer 6 Presentation Layer 7 5 Session Layer 4 Transport Layer 3 Network Layer 2 Data Link Layer 1 Physical Layer;

Wherein the upper layer (i.e. layers 7,6,5,4) defines the function of the application, the following three layers (i.e. layers 3,2) through the end of the network mainly for the data stream.

 

 


 

II. After the browser to enter a url

1. Go to the DNS to find domain IP

 

The IP TCP connection is established (three-way handshake)

 

3. The connection is established successfully launched http request

 

4. http server in response to the request

 

The browser parses the HTML code and requests the html static resources (js, css)

 

6. Close the TCP connection (four wave)

 

7. browsers rendering pages


 

III. The front to save data

VUEX stored in memory to refresh the page Clear

vuex is a state management mechanism, a change in the data component mapped to the other components of this data, i.e., data change one component to another component can be correspondingly

vuex for inter-component transfer value , the cookie, localStorage, sessionStorage used to pass values between pages .

Refresh the page vuex stored value is lost , the other three do not change;

The same data is available localStorage store,

Update the data vuex storage,

Communicate with the server data with cookie storage.


 

IV. Why use data in the form of return

 

JS in the examples are by constructor to create built, each new constructor can be a lot of instances, each instance will inherit a method or property on the prototype.

 

vue the data Data is actually vue properties of the prototype , the data present in the memory of which

 

vue order to ensure that data on each instance of data independence , mandated the use of the function , rather than the object .

 

Because the use of objects , then, data on the use of data for each instance (components) are affecting each other , which of course is not what we want.

The object is for the memory address referenced directly define the object, then will use this object between components , which can cause data between components influence each other .


 

V. commonjs -> nodejs

In order to make more powerful javascript, commonJs specification (CMD ) came into being, and it is the best representative nodejs, nodejs based commonjs specification and creation of the project, the project can be developed server-side projects.

JavaScript is not modular , the browser-dependent modules are introduced by introducing a script tag sequence determined, or to all of the code written in a file, and the definitions of all variables and functions are global. 


 

VI. About cross-domain

 Origin policy limits loaded from the same source document or script how and from another source resources to interact. This is one for isolating potentially malicious files important security mechanisms.

Browser is to do the same-origin policy from two aspects, one request interface , and second pin of Dom's search query


 

Seven .cookie

cookie everyone should know, it is generally used to process the logon and other scenes, the purpose is to let the server know who sent the request. If you request a login interface, after verification by the server will be added in response header Set-Cookie time field, then next time you send a request, the browser cookie will automatically be added to the header field Cookie HTTP request , the server You will be able to know the user is logged in before.


 

Eight .CSRF

   CSRF (Cross-site request forgery) , Chinese name: cross-site request forgery, also called: one click attack / session riding, abbreviated: CSRF / XSRF.
 You can understand CSRF attack: the attacker stole your identity to send malicious request on your behalf.

 

   To complete a CSRF attack , the victim must complete two steps in sequence:

 

  1. Log in to trusted sites A, and generates Cookie locally.

 

  2. In the case of A is not out of, access to dangerous websites B.

   CSRF defenses can be two aspects, from service and client defense effect is to proceed effective than from the server is better, now generally CSRF defense also performed at the server
  service side of the CSRF ways like a lot, but the general idea all is the same , that is, the increase in the client page pseudo-random number .


 

Nine .weex

Strong Weex not rely on any particular front frame. . Another major objective is Weex technology and Web development technology and native development to follow up the popular combination to achieve highly uniform development efficiency and operational performance. In the development stage, a Weex page as the development of generic web page as; at run time, Weex page and full advantage of the native capabilities of various components and operating systems .

Weex provides a basis for the built-in components . You can perform these basic components of the package, combine to form your own components; you can also create your own new components to packaging maps, video and other functions of the operating system. Access to  extended capabilities iOS  and  expand Android capabilities to understand how to implement custom components.

Inside the frame, Weex use native components to render and maintain multi-platform consistency as possible. But on different platforms, rendered more or less there will be some differences in behavior. For example, for  <switch> components, visual effects on different platforms is inconsistent.


 

Ten .http request error code

Some common status codes are:

200-- server successfully returned the page
404 - the requested page does not exist
503 - Service Unavailable

A detailed breakdown:

1xx (provisional response)
indicate a provisional response and require the requestor to continue operation of the status code.

Code Description
100 (continued) requestor should continue with the request. The server returns this code indicates a first part of the request has been received and is waiting for the rest. 
101 (Switching protocols) The requestor has switched protocol requires the server, the server is acknowledging that handover.

2xx (Successful)
expressed successfully processed the request status code.

Code Description
200 (success) server has successfully processed the request. Typically, this means that the server provided the requested page.
201 (Created) request was successful and the server created a new resource.
202 (accepted) server has accepted the request, but not yet processed.
203 (Non-authoritative information) The server successfully processed the request, but is returning information that may be from another source.
204 (no content) server successfully processed the request, but is not returning any content.
205 (Reset content) server successfully processed the request, but not returning any content.
206 (part of) the server successfully processed a partial GET request.

3xx (Redirection)
indicates to fulfill the request, further action is required. Typically, these status codes for redirection.

Code Description
300 (choice) for the request, the server may perform various operations. The server may operate a requestor (user agent) selected in accordance with, or provide a list of actions for the requester to select.
301 (Moved Permanently) permanently requested page has been moved to a new location. When the server returns this response (response to a GET or HEAD request), it automatically forwards the requestor to the new location.
302 (Temporary Mobile) respond to requests from the web server is currently a different location, but the requestor should continue to use the original location for future requests.
303 (See other location) requestor to retrieve the response should separate GET request to a different location, the server returns this code.
304 (Not Modified) since the last request, the requested page has not been modified. When the server returns this response, it does not return to the page content.
305 (use proxy) The requestor can only access the requested page using a proxy. If the server returns this response, it said requester use the agent.
307 (temporary redirect) server response to a request from a web page different from the current position, but the requestor should continue to use the original location for future requests.

4xx (Request error)
These status codes indicate that the request may be wrong, preventing the processing server.

Code Description
400 (Bad Request) server does not understand the syntax of the request.
401 (Unauthorized) The request requires authentication. For pages that require login, the server might return this response.
403 (Forbidden) server rejects the request.
404 (not found) server can not find the request.
405 (Method disabled) method specified in the request is disabled.
406 (not accepted) can not use the content characteristics requested in response to the requested page.
407 (Proxy Authentication Required) This status code 401 (not authorized), but specifies that the requestor should be authorized to use the proxy.
When a timeout occurs waiting for the request 408 (Request Timeout) server.
Conflict 409 (conflict) occurs when the server to complete the request. The server must include information about the conflict in the response.
410 (Deleted) If the requested resource has been permanently removed, the server returns this response.
411 (length) of the server does not accept the request without a valid Content-Length header field.
412 (Precondition Failed) where the server is not a prerequisite for the requestor in the request is satisfied.
413 (Request entity too large) server can not process the request because it is too large for the server to handle.
414 (Request URI is too long) URI (typically a URL) request is too long, the server can not handle.
415 (Unsupported Media Type) request in a format not supported requested page.
416 (Requested range not satisfiable) if the page can not provide the requested range, the server returns this status code.
417 (expected value) server can not meet "desired" request header field requirements.

5xx (Server Error)
These status codes indicate internal server error occurred while trying to process the request. These errors may be wrong server itself, not with the request.

Code Description
500 (Internal Server Error) The server encountered an error and can not fulfill the request.
501 (Not implemented) server does not have to complete the request. For example, the server might not return this code request identification method.
502 (Bad gateway) as a gateway or proxy server received an invalid response from the upstream server.
503 (Service Unavailable) server is currently unavailable (because it is overloaded or down for maintenance). Typically, this is a temporary state.
504 (Gateway Timeout) as a gateway or a proxy server, but the request is not received from the upstream server.
505 (HTTP Version not supported) server does not support HTTP protocol version used in the request.

 

Some common status codes are:

200-- server successfully returned the page
404 - the requested page does not exist
503 - Service Unavailable

A detailed breakdown:

1xx (provisional response)
indicate a provisional response and require the requestor to continue operation of the status code.

Code Description
100 (continued) requestor should continue with the request. The server returns this code indicates a first part of the request has been received and is waiting for the rest. 
101 (Switching protocols) The requestor has switched protocol requires the server, the server is acknowledging that handover.

2xx (Successful)
expressed successfully processed the request status code.

Code Description
200 (success) server has successfully processed the request. Typically, this means that the server provided the requested page.
201 (Created) request was successful and the server created a new resource.
202 (accepted) server has accepted the request, but not yet processed.
203 (Non-authoritative information) The server successfully processed the request, but is returning information that may be from another source.
204 (no content) server successfully processed the request, but is not returning any content.
205 (Reset content) server successfully processed the request, but not returning any content.
206 (part of) the server successfully processed a partial GET request.

3xx (Redirection)
indicates to fulfill the request, further action is required. Typically, these status codes for redirection.

Code Description
300 (choice) for the request, the server may perform various operations. The server may operate a requestor (user agent) selected in accordance with, or provide a list of actions for the requester to select.
301 (Moved Permanently) permanently requested page has been moved to a new location. When the server returns this response (response to a GET or HEAD request), it automatically forwards the requestor to the new location.
302 (Temporary Mobile) respond to requests from the web server is currently a different location, but the requestor should continue to use the original location for future requests.
303 (See other location) requestor to retrieve the response should separate GET request to a different location, the server returns this code.
304 (Not Modified) since the last request, the requested page has not been modified. When the server returns this response, it does not return to the page content.
305 (use proxy) The requestor can only access the requested page using a proxy. If the server returns this response, it said requester use the agent.
307 (temporary redirect) server response to a request from a web page different from the current position, but the requestor should continue to use the original location for future requests.

4xx (Request error)
These status codes indicate that the request may be wrong, preventing the processing server.

Code Description
400 (Bad Request) server does not understand the syntax of the request.
401 (Unauthorized) The request requires authentication. For pages that require login, the server might return this response.
403 (Forbidden) server rejects the request.
404 (not found) server can not find the request.
405 (Method disabled) method specified in the request is disabled.
406 (not accepted) can not use the content characteristics requested in response to the requested page.
407 (Proxy Authentication Required) This status code 401 (not authorized), but specifies that the requestor should be authorized to use the proxy.
When a timeout occurs waiting for the request 408 (Request Timeout) server.
Conflict 409 (conflict) occurs when the server to complete the request. The server must include information about the conflict in the response.
410 (Deleted) If the requested resource has been permanently removed, the server returns this response.
411 (length) of the server does not accept the request without a valid Content-Length header field.
412 (Precondition Failed) where the server is not a prerequisite for the requestor in the request is satisfied.
413 (Request entity too large) server can not process the request because it is too large for the server to handle.
414 (Request URI is too long) URI (typically a URL) request is too long, the server can not handle.
415 (Unsupported Media Type) request in a format not supported requested page.
416 (Requested range not satisfiable) if the page can not provide the requested range, the server returns this status code.
417 (expected value) server can not meet "desired" request header field requirements.

5xx (Server Error)
These status codes indicate internal server error occurred while trying to process the request. These errors may be wrong server itself, not with the request.

Code Description
500 (Internal Server Error) The server encountered an error and can not fulfill the request.
501 (Not implemented) server does not have to complete the request. For example, the server might not return this code request identification method.
502 (Bad gateway) as a gateway or proxy server received an invalid response from the upstream server.
503 (Service Unavailable) server is currently unavailable (because it is overloaded or down for maintenance). Typically, this is a temporary state.
504 (Gateway Timeout) as a gateway or a proxy server, but the request is not received from the upstream server.
505 (HTTP Version not supported) server does not support HTTP protocol version used in the request.

Guess you like

Origin www.cnblogs.com/huangqiao/p/11652721.html
Recommended