Highload осень 2012 лекция 3

399 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
399
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Highload осень 2012 лекция 3

  1. 1. • • • •
  2. 2. • • • • • • • •
  3. 3. • •
  4. 4. nginx.conf: location /b { expires 7d; alias /usr/local/www/static; } Response Headers: Cache-Control: max-age=604800 Expires: Fri, 05 Oct 2012 18:46:18 GMT Date: Fri, 28 Sep 2012 18:46:18 GMT • •
  5. 5. nginx.conf: location /d { add_header Cache-Control "private, no-cache, no-store"; } Response Headers: Cache-Control: private, no-cache, no-store • •
  6. 6. Request: GET /i/www/logo.png HTTP/1.1 Accept-Encoding: gzip,deflate Connection: keep-alive Host: img.yandex.net If-Modified-Since: Mon, 26 Apr 2010 08:00:35 GMT User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4 Response: 304 Not Modified Cache-Control: max-age=315360000 Connection: keep-alive Date: Fri, 28 Sep 2012 20:56:12 GMT Expires: Thu, 31 Dec 2037 23:55:55 GMT Last-Modified: Mon, 26 Apr 2010 08:00:35 GMT Server: nginx
  7. 7. GET / HTTP/1.1 Host: www.mail.ru Response Headers: Location: http://mail.ru/ • •
  8. 8. JavaScript: i = new Image(); i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACA UwAOw==”; CSS: background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA UCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllP AAAAKJJREFUeNrMVIsOhSAI7aDd///eXvQYNmdI1Gy7bGeQKR4OFJi5a2nUNbbmC SFoZtF5aW78VxpCkQZvNISzZP6cITmagALWXpMhDGngZYgbjW9ZkqMRtZLVOBgb0 zo9mYZQYQlnwkvSoJRTS2aNzfk+PhgR1/cdK+woey4lWZRY/dtoZZWejbHhlPAnzYm ZT2u9IMihecMo2ONhwyTx4VcBBgCpVBSNAzaJLAAAAABJRU5ErkJggg==")
  9. 9. • • • • •
  10. 10. nginx.conf: http { keepalive_timeout 60; ... } Response Headers: Connection: keep-alive • •
  11. 11. nginx.conf: http { gzip on; gzip_static on; ... } Response Headers: Content-Encoding: gzip • • •
  12. 12. Response Headers: Transfer-Encoding: chunked Response Headers: Content-Length: 42432 • •
  13. 13. • • • •
  14. 14. • • • •
  15. 15. nginx.conf: location /w3c/p3p.xml {} location /w3c/policy.xml {} add_header P3P "policyref="/w3c/p3p.xml", CP="NOI DSP COR NID PSAo PSDo OUR BUS UNI NAV STA INT""; Response Headers: P3P: policyref="/w3c/p3p.xml", CP="NOI DSP COR NID PSAo PSDo OUR BUS UNI NAV STA INT • • •
  16. 16. • • •

×