Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Http

1,315 views

Published on

HTTP basic & HTTP 2

Published in: Engineering
  • Be the first to comment

Http

  1. 1. Luavis http://github.com/luavis HTTP Hyper Text Transfer Protocol
  2. 2. Luavis http://github.com/luavis HTTP Hyper Text Transfer Protocol History Packet Method Status Code Headers 2
  3. 3. Hyper Text HTML Hyper Text Markup Language
  4. 4. Hyper Text Transfer 하이퍼 텍스트를옮기는 프로토콜 Protocol
  5. 5. History HTTP
  6. 6. Tim Berners-Lee and his team at CERN
  7. 7. - Berners-Lee first proposed the "WorldWideWeb" project in 1989. - The first documented version of HTTP was HTTP V0.9 (1991). - Dave Raggett led the HTTP Working Group (HTTP WG) in 1995. - RFC 1945 officially introduced and recognized HTTP V1.0 in 1996. - The HTTP/1.1, RFC 2068 was officially released in January 1997
  8. 8. Packet HTTP
  9. 9. Protocol Network Application Presentation Session Transfer Data link Physical OSI 7 Layers
  10. 10. Protocol Network Application Presentation Session Transfer Data link Physical TCP/IP/Ethernet HTTP
  11. 11. Packet It is text based HTTP/1.1 200 OK Date: Thu, 20 May 2010 01:43:23 GMT Server: Nginx/1.3 Cache-Control: no-cache, no-Store <html> <p>hello World</p> </html> GET / HTTP/1.1
  12. 12. Request packet POST / HTTP/1.1 Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0 Accept-Encoding:gzip, deflate, sdch Accept-Language:ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4,ja;q=0.2 Cache-Control:max-age=0 Connection:keep-alive Host:www.w3.org Referer:https://www.google.co.kr/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.3 search=google&utf-8=&page=10
  13. 13. POST / HTTP/1.1 Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0 Accept-Encoding:gzip, deflate, sdch Accept-Language:ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4,ja;q=0.2 Cache-Control:max-age=0 Connection:keep-alive Host:www.w3.org Referer:https://www.google.co.kr/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.3 search=google&utf-8=&page=10 Request packet
  14. 14. Request packet POST / HTTP/1.1 Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0 Accept-Encoding:gzip, deflate, sdch Accept-Language:ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4,ja;q=0.2 Cache-Control:max-age=0 Connection:keep-alive Host:www.w3.org Referer:https://www.google.co.kr/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.3 search=google&utf-8=&page=10
  15. 15. Request packet POST / HTTP/1.1 Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0 Accept-Encoding:gzip, deflate, sdch Accept-Language:ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4,ja;q=0.2 Cache-Control:max-age=0 Connection:keep-alive Host:www.w3.org Referer:https://www.google.co.kr/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.3 search=google&utf-8=&page=10
  16. 16. HTTP/1.1 200 OK Content-Language:en Content-Location:O-HTTP-charset.en.php Content-Type:text/html; charset=UTF-8 Date:Tue, 19 May 2015 15:23:39 GMT P3P:policyref="http://www.w3.org/2014/08/p3p.xml" Server:Apache/2 TCN:choice Transfer-Encoding:chunked Vary:negotiate,accept-language <html> <p>hello World</p> </html> Response packet
  17. 17. HTTP/1.1 200 OK Content-Language:en Content-Location:O-HTTP-charset.en.php Content-Type:text/html; charset=UTF-8 Date:Tue, 19 May 2015 15:23:39 GMT P3P:policyref="http://www.w3.org/2014/08/p3p.xml" Server:Apache/2 TCN:choice Transfer-Encoding:chunked Vary:negotiate,accept-language <html> <p>hello World</p> </html> Response packet
  18. 18. HTTP/1.1 200 OK Content-Language:en Content-Location:O-HTTP-charset.en.php Content-Type:text/html; charset=UTF-8 Date:Tue, 19 May 2015 15:23:39 GMT P3P:policyref="http://www.w3.org/2014/08/p3p.xml" Server:Apache/2 TCN:choice Transfer-Encoding:chunked Vary:negotiate,accept-language <html> <p>hello World</p> </html> Response packet
  19. 19. HTTP/1.1 200 OK Content-Language:en Content-Location:O-HTTP-charset.en.php Content-Type:text/html; charset=UTF-8 Date:Tue, 19 May 2015 15:23:39 GMT P3P:policyref="http://www.w3.org/2014/08/p3p.xml" Server:Apache/2 TCN:choice Transfer-Encoding:chunked Vary:negotiate,accept-language <html> <p>hello World</p> </html> Response packet
  20. 20. GET / HTTP/1.1 Method Path Version Request packet
  21. 21. Method HTTP
  22. 22. GET / HTTP/1.1 Method Path Version Method GET HEAD POST PUT DELETE TRACE OPTIONS CONNECT PATCH Request packet
  23. 23. GET / HTTP/1.1 Method Path Version Method GET HEAD POST PUT DELETE TRACE OPTIONS CONNECT PATCH General Usage Request packet
  24. 24. GET / HTTP/1.1 Method Path Version Request packet Method GET HEAD POST PUT DELETE TRACE OPTIONS CONNECT PATCH RESTFUL Usage
  25. 25. GET HEAD PUT DELETE OPTIONS CONNECT 자료를 요청 Requests a representation of the specified resource. Asks for the response identical to the one that would correspond to a GET request, but without the response body. 자료의 존재 요청 POST TRACE 자료 업로드 Requests that the server accept the entity enclosed in the request 자료 수정 Requests that the enclosed entity be stored under the supplied, If already existing resource, it is modified 자료 삭제 Deletes the specified resource Echoes back the received request changes or additions 서버 확인 Returns the HTTP methods that the server supports for the specified URL 가능한 메소드 확인 Converts the request connection to a transparent TCP/IP tunnel Applies partial modifications to a resource PATCH 부분적 수정
  26. 26. GET 자료를 요청 Requests a representation of the specified resource. C has published guidance principles on this distinction, saying, "Web applicatio
  27. 27. HEAD Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. 자료의 존재 요청
  28. 28. Requests that the server accept the entity enclosed in the request as a new subordinate of the web resource identified by the URI. The data POSTed might be, for example, an annotation for existing resources; a message for a bulletin board, newsgroup, mailing list, or comment thread; a block of data that is the result of submitting a web form to a data-handling process; or an item to add to a database. POST 자료 업로드
  29. 29. Requests that the enclosed entity be stored under the supplied URI. If the URI refers to an already existing resource, it is modified; if the URI does not point to an existing resource, then the server can create the resource with that URI. PUT 자료 수정
  30. 30. Deletes the specified resource. DELETE 자료 삭제
  31. 31. eived request so that a client can see what (if any) changes or additions have been made by i TRACE 서버 확인
  32. 32. Converts the request connection to a transparent TCP/IP tunnel, usually to facilitate SSL-encrypted communication (HTTPS) through an unencrypted HTTP proxy. See HTTP CONNECT tunneling. OPTIONS 가능한 메소드 확인
  33. 33. Returns the HTTP methods that the server supports for the specified URL. This can be used to check the functionality of a web server by requesting instead of a specific resource. CONNECT
  34. 34. Applies partial modifications to a resource. PATCH 부분적 수정
  35. 35. GET / HTTP/1.1 Method Path Version Request packet
  36. 36. http://see.ssu.ac.kr/pydio/4.Enjoy/Movies
  37. 37. http:// see.ssu.ac.kr /pydio/4.Enjoy/Movies/ pathdomainprotocol
  38. 38. HTTP/1.1 Content-Language:en Content-Location:O-HTTP-charset.en.php Content-Type:text/html; charset=UTF-8 Date:Tue, 19 May 2015 15:23:39 GMT P3P:policyref="http://www.w3.org/2014/08/p3p.xml" Server:Apache/2 TCN:choice Transfer-Encoding:chunked Vary:negotiate,accept-language <html> <p>hello World</p> </html> Response packet 200 OK
  39. 39. HTTP/1.1 Content-Language:en Content-Location:O-HTTP-charset.en.php Content-Type:text/html; charset=UTF-8 Date:Tue, 19 May 2015 15:23:39 GMT P3P:policyref="http://www.w3.org/2014/08/p3p.xml" Server:Apache/2 TCN:choice Transfer-Encoding:chunked Vary:negotiate,accept-language <html> <p>hello World</p> </html> Response packet 200 OK
  40. 40. Status Code HTTP
  41. 41. For example
  42. 42. 100 200 300 400 500 Status code <response code>
  43. 43. Informational 1xx 100 Continue 서버는 이 코드를 제공하여 요청의 첫 번째 부분을 받았으며 나머지를 기다리고 있음을 나타낸 101 Switching Protocols 서버에 프로토콜 전환을 요청했으며 서버는 이를 승인하는 중이다.
  44. 44. 200 OK 이는 주로 서버가 요청한 페이지를 제공했다는 의미로 쓰인 201 Created 서버가 새 리소스를 작성했다. 202 Accepted 접수했지만 아직 처리하지 않았다. 203 Non-Authoritative Information 다른 소스에서 수신된 정보를 제공하고 있다. 204 No Content 처리했지만 콘텐츠를 제공하지 않는다. 205 Reset Content 문서 보기를 재설정할 것을 요구한다 206 Partial Content 일부만 성공적으로 처리했다. Successful 2xx
  45. 45. 300 Multiple Choices 서버가 사용자 에이전트에 따라 수행할 작업을 선택하거나 요청자가 선택할 수 있는 작업 목록을 제공한다. 301 Moved Permanently GET 또는 HEAD 요청에 대한 응답으로 이 응답을 표시하면 요청자가 자동으로 새 위치로 전달된다 302 Found 요청자는 향후 요청 시 원래 위치를 계속 사용해야 한다. 304 Not Modified 마지막 요청 이후 요청한 페이지는 수정되지 않았다. 307 Temporary Redirect 현재 서버가 다른 위치의 페이지로 요청에 응답하고 있지만 요청자는 향후 요청 시 원래 위치를 계속 사용해야 한다. Redirection 3xx
  46. 46. 400 Bad Request 서버가 요청의 구문을 인식하지 못했다. 401 Unauthorized 서버는 로그인이 필요한 페이지에 대해 이 요청을 제공할 수 있다. 404 Not Found 서버가 요청한 페이지를 찾을 수 없다. 405 Method Not Allowed 요청에 지정된 방법을 사용할 수 없다. 408 Request Timeout 서버의 요청 대기가 시간을 초과하였다. 413 Request Entity Too Large 요청이 너무 커서 서버가 처리할 수 없다. Client Error 4xx
  47. 47. Server Error 5xx 500 Internal Server Error 서버에 오류가 발생하여 요청을 수행할 수 없다. 501 Not Implemented 서버에 요청을 수행할 수 있는 기능이 없다. 502 Bad Gateway 서버가 게이트웨이나 프록시일때, 업스트림 서버에서 잘못된 응답을 받았다. 503 Service Unavailable 서버가 오버로드되었거나 유지관리를 위해 다운됨. 504 Gateway Timeout 서버가 게이트웨이나 프록시일때, 응답을 제때 못 받았다. 505 HTTP Version Not Supported 사용된 HTTP 프로토콜 버전을 지원하지 않는다.
  48. 48. Headers HTTP
  49. 49. Accept Accept-Charset Accept-Features Accept-Encoding Accept-Language Accept-Ranges Access-Control-Allow-Credentials Access-Control-Allow-Origin Access-Control-Allow-Methods Access-Control-Allow-Headers Access-Control-Max-Age Access-Control-Expose-Headers Access-Control-Request-Method Access-Control-Request-Headers If-None-Match If-Range If-Unmodified-Since Last-Event-ID Last-Modified Link Location Max-Forwards Negotiate Origin Pragma Proxy-Authenticate Proxy-Authorization Range Referer Retry-After Sec-Websocket-Extensions Sec-Websocket-Key Sec-Websocket-Origin Sec-Websocket-Protocol Sec-Websocket-Version Server Set-Cookie Set-Cookie2 Strict-Transport-Security TCN TE Transfer-Encoding Upgrade User-Agent Variant-Vary Vary Via Warning WWW-Authenticate X-Content-Duration X-Content-Security-Policy X-DNSPrefetch-Control X-Frame-Options X-Requested-With Age Allow Alternates Authorization Cache-Control Connection Content-Encoding Content-Language Content-Length Content-Location Content-MD5 Content-Range Content-Security-Policy Content-Type Cookie Date ETag Expect Expires From Host If-Match If-Modified-Since
  50. 50. Accept-Charset Accept-Features Accept-Encoding Accept-Language Accept-Ranges Access-Control-Allow-Credentials Access-Control-Allow-Origin Access-Control-Allow-Methods Access-Control-Allow-Headers Access-Control-Max-Age Access-Control-Expose-Headers Access-Control-Request-Method Access-Control-Request-Headers If-None-Match If-Range If-Unmodified-Since Last-Event-ID Last-Modified Link Location Max-Forwards Negotiate Origin Pragma Proxy-Authenticate Proxy-Authorization Range Referer Retry-After Sec-Websocket-Extensions Sec-Websocket-Key Sec-Websocket-Origin Sec-Websocket-Protocol Sec-Websocket-Version Server Set-Cookie Set-Cookie2 Strict-Transport-Security TCN TE Transfer-Encoding Upgrade User-Agent Variant-Vary Vary Via Warning WWW-Authenticate X-Content-Duration X-Content-Security-Policy X-DNSPrefetch-Control X-Frame-Options X-Requested-With Age Allow Alternates Authorization Cache-Control Connection Content-Encoding Content-Language Content-Length Content-Location Content-MD5 Content-Range Content-Security-Policy Content-Type Cookie Date ETag Expect Expires From Host If-Match If-Modified-Since
  51. 51. Accept Accept-Charset Accept-Encoding Accept-Language Accept-Ranges Last-Modified Location Origin Pragma Range Referer Server Set-Cookie Transfer-Encoding User-Agent WWW-Authenticate X-Content-Security-Policy X-Frame-Options X-Requested-With Cache-Control Content-Encoding Content-Language ETag Expires Host Content-Length Content-Range Content-Type Cookie Date
  52. 52. Server : 어떤 서버 프로그램의 정보를 클라이언트에게 제공 Host : 요청하는 도메인을 제공 ex) Server: nginx/1.7 ex) Host: www.example.com Location : Moved 일 경우 이동할 주소를 제공 ex) Location: www.example.com ex) Date: Wed, 15 Nov 1995 06:25:24 GMT Date : 서버의 시간을 제공
  53. 53. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 클라이언트가 서버에게 받을 수 있는 파일의 형식 정의
  54. 54. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 format;q=0.9
  55. 55. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 format;quality=0.9 from 0.0 to 1.0
  56. 56. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 MIME TYPE
  57. 57. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 MIME TYPE 전자우편은 7비트 ASCII 문자를 사용하여 전송되기 때문에, 8비트 이상의 코드를 사용하는 문자나 이진 파일들은 MIME 포맷으로 변환되어 SMTP로 전송된다.
  58. 58. Accept-Charset: iso-8859-5, unicode-1-1;q=0.8 ASCII, EUC-KR, EUC-JP, CP949, UTF-8…etc
  59. 59. Content-Type: text/html; charset=utf-8 서버가 클라이언트에게 보내는 내용의 type을 알려줌
  60. 60. Accept-Encoding: gzip, deflate, sdch
  61. 61. Accept-Encoding: gzip, deflate, sdch
  62. 62. compress – UNIX "compress" program method deflate – compression based on the deflate algorithm, wrapped inside the zlib data format exi – W3C Efficient XML Interchange gzip – GNU zip format. This method is the most broadly supported identity – No transformation is used. This is the default value for content coding. pack200-gzip – Network Transfer Format for Java Archives. bzip2 – compression based on the free bzip2 format, supported by lighttpd lzma – compression based on (raw) LZMA is available in Opera 20, and in elinks via a compile-time option peerdist – Microsoft Peer Content Caching and Retrieval sdch – Google Shared Dictionary Compression for HTTP, based on VCDIFF. xz - LZMA2-based content compression, supported by a non-official Firefox patch. Accept-Encoding: gzip, deflate, sdch
  63. 63. Content-Encoding: gzip 서버가 클라이언트에게 보내는 내용의 압축방식을 알려줌
  64. 64. Accept-Language 클라이언트가 서버에게 받을 수 있는 언어의 종류를 보냄
  65. 65. Accept-Language ISO 639-1 Code
  66. 66. Accept-Language ISO 639-1 Code 2글자로 나타낸 언어코드 ko, en, ja, zh…
  67. 67. Accept-Language ISO 639-1 Code 2글자로 나타낸 언어코드 ko-kr, en-us, en-gb, ja-jp, zh-cn, zh-tw… Accept-Language: ko-kr,ko;q=0.8,en-us;q=0.5,en;q=0.3
  68. 68. Content-Language: ko-kr 서버가 클라이언트에게 보내는 내용의 언어를 알려줌
  69. 69. Content-Length: 23021 서버가 클라이언트에게 보내는 내용의 크기를 바이트 단위로 알려줌
  70. 70. User-Agent
  71. 71. User-Agent 클라이언트가 서버에게 보내는 브라우저의 정보를 알려줌
  72. 72. Netscape
  73. 73. Mozilla/2.02Gold (Win95; I)
  74. 74. Mozilla/2.02Gold (Win95; I) ????
  75. 75. Mozilla/2.02Gold (Win95; I) Mozilla/1.22 (compatible; MSIE 2.0; Windows 95)
  76. 76. Mozilla/2.02Gold (Win95; I) Mozilla/1.22 (compatible; MSIE 2.0; Windows 95) ????
  77. 77. Mozilla/2.02Gold (Win95; I) Mozilla/1.22 (compatible; MSIE 2.0; Windows 95) osh; U; PPC Mac OS X; en) AppleWebKit/312.8.1 (KHTML, like G
  78. 78. Mozilla/2.02Gold (Win95; I) 64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6 osh; U; PPC Mac OS X; en) AppleWebKit/312.8.1 (KHTML, like G
  79. 79. Mozilla/2.02Gold (Win95; I) 64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; Media Center PC 6 osh; U; PPC Mac OS X; en) AppleWebKit/312.8.1 (KHTML, like G ????
  80. 80. la/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like G osh; U; PPC Mac OS X; en) AppleWebKit/312.8.1 (KHTML, like G Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chro
  81. 81. Cookie
  82. 82. 서버와 클라이언트 간의 데이터를 저장해둠 Cookie
  83. 83. luavis
  84. 84. luavis
  85. 85. Cookie: user=luavis; grade=2; 클라이언트가 서버에게 쿠키값을 알려줌
  86. 86. Set-Cookie: lu=Rg3vHJZnehYLjVg7qi3bZjzg; Expires=Tue, 15-Jan-2013 2 Set-Cookie: made_write_conn=1295214458; Path=/; Domain=.example.co Set-Cookie: reg_fb_gate=deleted; Expires=Thu, 01-Jan-1970 00:00:01 GM 서버가 클라이언트에게 쿠키값을 설정하라 지시
  87. 87. Set-Cookie: lu=Rg3vHJZnehYLjVg7qi3bZjzg; Expires=Tue, 15-Jan-2013 2 Set-Cookie: made_write_conn=1295214458; Path=/; Domain=.example.co Set-Cookie: reg_fb_gate=deleted; Expires=Thu, 01-Jan-1970 00:00:01 GM
  88. 88. Set-Cookie: lu=Rg3vHJZnehYLjVg7qi3bZjzg; Expires=Tue, 15-Jan-2013 2 Set-Cookie: made_write_conn=1295214458; Path=/; Domain=.example.co Set-Cookie: reg_fb_gate=deleted; Expires=Thu, 01-Jan-1970 00:00:01 GM
  89. 89. Set-Cookie: lu=Rg3vHJZnehYLjVg7qi3bZjzg; Expires=Tue, 15-Jan-2013 2 Set-Cookie: made_write_conn=1295214458; Path=/; Domain=.example.co Set-Cookie: reg_fb_gate=deleted; Expires=Thu, 01-Jan-1970 00:00:01 GM Persistent cookie
  90. 90. Set-Cookie: lu=Rg3vHJZnehYLjVg7qi3bZjzg; Expires=Tue, 15-Jan-2013 2 Set-Cookie: made_write_conn=1295214458; Path=/; Domain=.example.co Set-Cookie: reg_fb_gate=deleted; Expires=Thu, 01-Jan-1970 00:00:01 GM
  91. 91. Set-Cookie: lu=Rg3vHJZnehYLjVg7qi3bZjzg; Expires=Tue, 15-Jan-2013 2 Set-Cookie: made_write_conn=1295214458; Path=/; Domain=.example.co Set-Cookie: reg_fb_gate=deleted; Expires=Thu, 01-Jan-1970 00:00:01 GM
  92. 92. Keep-Alive
  93. 93. Keep-Alive default HTTP when keep alive
  94. 94. HTTP 1.1 HTTP 1.0 Connection: Keep-Alive <not official> Keep-Alive: timeout=5, max=100 Connection: Keep-Alive
  95. 95. Cache
  96. 96. Cache 종 도큐먼트들의 지속적인 요청을 피하기 위해 클라이언트에 임시저
  97. 97. For example…
  98. 98. For example… 왠만한 일 아니면 바뀔일이 없음
  99. 99. Cache-Control: public, max-age=3600, must-revalidate Cache-Control: no-cache HTTP 1.1 HTTP 1.0 Expire: Thu, 01 Dec 1983 20:00:00 GMT Pragma: cache Pragma: no-cache
  100. 100. - Request headerHTTP 1.1 General-header Request-header Entity-Header
  101. 101. - Request headerHTTP 1.1 Cache control Check modified
  102. 102. - Request headerHTTP 1.1 General-header Cahce-Control max-age=sec sec보다 오래된 데이터는 캐시하지 않음
  103. 103. - Request headerHTTP 1.1 General-header Cahce-Control max-age=0 End-to-End revalidation 모든 프록시에 대해 재검증 요청
  104. 104. - Request headerHTTP 1.1 Check modified If-Match If-None-Match 해당 e-tag가 있어야 진행이 됨 해당 e-tag가 존재하지 않아야 진행
  105. 105. - Request headerHTTP 1.1 Check modified e-tag The ETag or entity tag is part of HTTP. It is one of several mechanisms that HTTP provides for web cache validation. It is provided by server.
  106. 106. - Request headerHTTP 1.1 Check modified If-Match 해당 e-tag가 있어야 진행이 됨 412 (Precondition Failed) response Condition : - none of the entity tags match, - “*" is given and no current entity exists Ignore Condition : - any of the entity tags match - if the request results in anything other than a 2xx or 412 status (without If-M - if "*" is given and any current entity exists for the resource
  107. 107. - Request headerHTTP 1.1 Check modified If-None-Match 해당 e-tag가 존재하지 않아야 진행 304 Not Modified Condition : - e tag is existed If-None-Match: * 304 Not Modified Condition : - if the resource is there and the other condition is met
  108. 108. If-Modified-Since: <date> - Request headerHTTP 1.1 Check modified 해당 날짜로 부터 변경 사항이 있는가 확인
  109. 109. - Response headerHTTP 1.1 Cache control Checksum header
  110. 110. - Response headerHTTP 1.1 Cache control Cache-Control: public, max-age=3600, must-revalidate Cache-Control: no-store Cache-Control: no-cache
  111. 111. - Response headerHTTP 1.1 Cache control Cache-Control: public, max-age=3600, must-revalidate proxy-revalidateprivate 수명 재확인
  112. 112. Proxy Server Client cached cached - Response headerHTTP 1.1 Cache control In public
  113. 113. Proxy Server Client not-cached cached In private - Response headerHTTP 1.1 Cache control
  114. 114. - Response headerHTTP 1.1 Checksum header E-tag Last-Modified Expires Data 고유의 entity tag 최종 수정일 수명
  115. 115. Google image resources
  116. 116. Google image resources WHAT??
  117. 117. The max-age directive takes priority over Expires, so if max-age is present in a response, the calculation is simply: freshness_lifetime = max_age_value Otherwise, if Expires is present in the response, the calculation is: freshness_lifetime = expires_value - date_value
  118. 118. CDN work like proxy
  119. 119. IF…. optical fiber
  120. 120. IF…. optical fiber 1 sec = 7.5 revolution for half rev = 66ms
  121. 121. CDN work like proxy
  122. 122. Cookie Keep-alive Cache Accept Content control User-agent
  123. 123. 2 HTTP
  124. 124. - Berners-Lee first proposed the "WorldWideWeb" project in 1989. - The first documented version of HTTP was HTTP V0.9 (1991). - Dave Raggett led the HTTP Working Group (HTTP WG) in 1995. - RFC 1945 officially introduced and recognized HTTP V1.0 in 1996. - The HTTP/1.1, RFC 2068 was officially released in January 1997
  125. 125. HTTP
  126. 126. In 1998 google
  127. 127. In now time google
  128. 128. 엄청난 진보 = 전체 페이지 사이즈 증
  129. 129. 훨씬 더 많은 리소스로 구성되어 있다. 다수의 도메인을 사용한다. 과거에 비해 매우 동적으로 동작한다. 보안이 보다 중요한 이슈가 되었다. 헤더의 길이가 길어졌다.
  130. 130. 훨씬 더 많은 리소스로 구성되어 있다. 다수의 도메인을 사용한다. 과거에 비해 매우 동적으로 동작한다. 보안이 보다 중요한 이슈가 되었다. 헤더의 길이가 길어졌다.
  131. 131. Layers
  132. 132. Layers 항상 TLS 위에서 동작 HTTP 헤더 압축 바이너리 프로토콜 Multiplexing 웹 사이트를 재작성할 필요 없음 Server Push
  133. 133. 항상 TLS 위에서 동작 TLS(SSL)의 기본 탑재 서버 보안의 중요성 증가
  134. 134. HTTP 헤더 압축 기존 encoding: gzip은 압축은 startline과 header는 압축을 안함.
  135. 135. Cookie와 User-agent의 길이 증가, 같은 헤더의 지속적 요청..
  136. 136. 요즘 웹의 실태
  137. 137. 바이너리 프로토콜 패킷의 사이즈를 줄일 수 있음.
  138. 138. Multiplexing
  139. 139. Server Push
  140. 140. HTTPS 대비 55% 기존에 비해 효율
  141. 141. HTTP/2
  142. 142. HTTP 프로토콜의 두 번째 버전 SPDY에 기반하고 있으며, 국제 인터넷 표준화 기구(IETF)에서 개발되고 있다. HTTP/2
  143. 143. Spdy HTTP/2 TLS(SSL) Required. SSL Not Required. Fast Encrypted Connections. ​Faster Encrypted Connections. Single-Host Multiplexing. ​Multi-Host Multiplexing. ​Compression. Faster, More Secure Compression. ​Prioritization. Improved Prioritization.
  144. 144. The HTTP/2 specification was published as RFC 7540 in 14 May 2015.
  145. 145. IIS supports HTTP/2 in Windows 10 beta NGINX plans to support HTTP/2 by the end of 2015 Apache SPDY via the mod_spdy module Server Compatibility Browser Chrome supports HTTP/2 by default (version 41) Firefox supports HTTP/2 enabled by default (version 36) IE supports HTTP/2 (version 11, but only for Windows 10 beta)
  146. 146. References http://nuli.navercorp.com/sharing/blog/post/1132452 https://www.maxcdn.com/blog/spdy-http2-shift/ http://cacm.acm.org/magazines/2012/12/157870-spdying-up-the-web/abstract http://www.slideshare.net/oddpoet/spdy-13231459 http://helloworld.naver.com/ http://www.w3.org/ http://wikipedia.org/ http://wpcertification.blogspot.kr/2010/07/difference-between-no-cache-and-no.html http://icecreamie.tistory.com/52 http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/ Thanks! 감사합니다! ありがとう! QnA? 谢谢!

×