본문 바로가기

나의 FE피봇이야기/Dev_Knowledge

[Lecture]Network : Cookies, Proxy Server

Cookies

 

 

1) 서버가 cookes를  initiate 해   (ID == set-cookie) 라는 필드로 넣어 Response to User.

- 서버에서 Unique ID 생성  in Server's Backend Database.

2) 브라우저는 서버가 알려준 Cookies ID 정보 저장

3) 다음에 다시 요청할 때, cookies 값에 ID 담아서 요청 -> 서버는 해당 클라이언트를 cookies(history, keyword etc)  관리할 수 있음

 

User <-> Server ID Process

 

cookie-specific action

- stored a User information in Server Database by customized data stucture.

If user has got a cookie information already, send a request with COOKIE HEADLINE included ID to the Server.

 

 

User Side Pros

1. Session State Keep without authorization

No, session Keep

1) a web site visit 1) Log in 2) post message 3) Log in seccess 4) Session done

Yes, session Keep

1) a web site visit 1) Log in 2) post message 3) Log in seccess 4) Keep the session from server

 

Server Side Pros

1) Collecting User behavior Data (what content the user click or check, what time the user visit in the site etc) -> Recommedation

 

 

 

Web cache == Proxy Sever

Goal : 본점에까지 가지 않고 분점에서 해결

캐시를 로컬 사이트에 놔둠으로써 본점(Original Sever)까지 가지 않고도 Object를 획득할 수 있게 (단 Object는 Proxy server에 있을 수도 있고 없을 수도 있다.)

 

Proxy Server Role : Cilent 와 Server  둘 다 역할 가능(Cashe acts as both client and server)

 

처음에 Proxy Server에 Object가 없었는데 누군가 요청을 통해 Object를 Original로부터 획득했다면, Proxy Server에는 the Object가 존재 함으로 다음 동일한 Object 요청시에는 Proxy Server에서 바로 전달 가능.

 

Why Proxy Server Need?

1. Reduce Response time.

2. Reduce data traffic. Such as a big companies or University have a connected bandwdith(access link) with ISP Company. All data traffic number is to be cost. Therefore a Proxy Sever shrink a certain mount of data, cost.

3. Poor content providers.

 

 

Hit Rate : 적중률(전체중 적중할 확률)

 

여기서 Hit Rate 0.4(10번 중 4번은 Proxy Server 에서  object를 획득한다 라는 뜻, 0.4의 비율이기때문에 1에서 가까워지지 않음

나머지 0.6은 1에 가깝지만  견딜만한 상황.

 

Proxy Server Data Check with Original Data

Using a code Proxy Server Data comparing to Original Server Data.

if-modified-since 필드 at Pocket Head를 check 를 통해서 data version 서로 확인.

단, 통신시에는 Object를 주고 받는게 아니라 상태 정보만 받는다.

 

 

 

Chater 2 : Outline

Electronic Mail

 

Uses TCP to reliably transfer email message from client to server, port 25.

 

3 phase of transfer

  • Handshaking (Greeting)
  • Transfer of messages
  • Closure

 

Command/response interaction (like HTTP, FTP)

  • commands : ASCII text
  • response : status code and phrase

 

Messages must be in 7-bit ASCII(Modern Eletronic mail does send more than a text)