Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no protocolo HTTP
-
Upload
leonel-morgado -
Category
Education
-
view
5.425 -
download
1
description
Transcript of Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no protocolo HTTP
Suporte para cache no protocolo HTTP
2011-2012
Metodologias de Programação IV
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
HTTP/1.1 200 OKContent-Type: text/html………
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
HTTP/1.1 200 OKContent-Type: text/html……… + 40.318 bytes
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
HTTP/1.1 200 OKContent-Type: text/htmlDate: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMT… + 40.318 bytes
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
HTTP/1.1 200 OKContent-Type: text/htmlDate: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMT… + 40.318 bytes
Last-Modified: Sun, 16 Oct 2011 07:49:26 GMT
Last-Modified: Thu, 29 Jan 2009 02:09:59 GMT
Last-Modified: Wed, 17 Sep 2003 14:46:36 GMT
Last-Modified: Sat, 06 Feb 2010 19:47:46 GMT
Last-Modified: Thu, 02 Jul 2009 02:19:00 GMT
Last-Modified: Wed, 29 Sep 2010 16:33:13 GMT
//v1.7// Flash Player Version Detection// Detect Client Browser type
Cliente Servidor
Cliente Servidor
...
Proxies
HEAD /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
HTTP/1.1 200 OKContent-Type: text/htmlDate: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMT… + 0 bytes
HTTP/1.1 200 OKConnection: Keep-AliveClient-response-num: 1Keep-Alive: timeout=15, max=100Set-Cookie: AF_SID=b672a03f4a0338f035131f6b8034ff33; path=/Date: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMTClient-peer: 65.98.99.99.166:80Client-date: Sun, 16 Oct 2011 16:20:34 GMTContent-Type: text/htmlServer: Apache/1.3.41 (Unix) mod_perl/1.31 mod_ssl/2.8.31 OpenSSL/0.9.8e
HEAD /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
420 bytes
HTTP/1.1 200 OKConnection: Keep-AliveClient-response-num: 1Keep-Alive: timeout=15, max=100Set-Cookie: AF_SID=b672a03f4a0338f035131f6b8034ff33; path=/Date: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMTClient-peer: 65.98.99.99.166:80Client-date: Sun, 16 Oct 2011 16:20:34 GMTContent-Type: text/htmlServer: Apache/1.3.41 (Unix) mod_perl/1.31 mod_ssl/2.8.31 OpenSSL/0.9.8e
HEAD /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.pt...
420 bytes
Mas se se tiver alterado em relação à cópia em cache…
GET /tc/home.html...
Cliente Servidor
HEAD ...
HTTP/1.1 200 OK
Cliente Servidor
HEAD ...
GET ...
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OKDate: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMTServer: Apache/1.3.41 (Unix) mod_perl/1.31 mod_ssl/2.8.31 OpenSSL/0.9.8eSet-Cookie: AF_SID=7896d3ac9d40552973a20a4e6cd7ceac; path=/Keep-Alive: timeout=15, max=100Connection: Keep-AliveTransfer-Encoding: chunkedContent-Type: text/html
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.ptIf-Modified-Since: Fri, 14 Oct 2011 19:08:24 GMT...
+ 40.318 bytes
HTTP/1.1 200 OKDate: Sun, 16 Oct 2011 16:20:34 GMTLast-Modified: Sun, 16 Oct 2011 07:49:25 GMTServer: Apache/1.3.41 (Unix) mod_perl/1.31 mod_ssl/2.8.31 OpenSSL/0.9.8eSet-Cookie: AF_SID=7896d3ac9d40552973a20a4e6cd7ceac; path=/Keep-Alive: timeout=15, max=100Connection: Keep-AliveTransfer-Encoding: chunkedContent-Type: text/html
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.ptIf-Modified-Since: Fri, 14 Oct 2011 19:08:24 GMT...
+ 40.318 bytes
HTTP/1.1 304 Not modifiedConnection: Keep-AliveKeep-Alive: timeout=15, max=99Date: Sun, 16 Oct 2011 18:26:07 GMTClient-peer: 65.98.99.166:80Etag: "e05af-19db-4a4beb1b“Client-date: Sun, 16 Oct 2011 18:26:06 GMTServer: Apache/1.3.41 (Unix) mod_perl/1.31 mod_ssl/2.8.31 OpenSSL/0.9.8e
GET /tc/home.html HTTP/1.1Host: www.tribunalconstitucional.ptIf-Modified-Since: Sun, 16 Oct 2011 07:49:25 GMT...
299 bytes
Cliente Servidor
GET ...
HTTP/1.1 200 OK
HTTP/1.1 304 Not modified
HEAD If-Modified-Since
HEAD If-Modified-Since
“HTTP/1.1 implements a more efficient approach to this problem using two new headers: If-Modified-Since and (...)” (p. 58)
HEAD If-Modified-Since
“HTTP/1.1 implements a more efficient approach to this problem using two new headers: If-Modified-Since and (...)” (p. 58)
HEAD If-Modified-Since
http://bit.ly/oNhktc
HEAD If-Modified-Since
Ideal para cacheAlternativa p/ cache
Recolha delistas de recursos
HEAD If-Modified-Since
Ideal para cacheAlternativa p/ cache
Recolha delistas de recursos
Leituras associadas
Web Application Architecture, Second EditionCap. 3: “Birth of the Web: HTTP”, pp. 49-51 e 58-59.
Krishnamurthy, B.; Mogul, J.; Kristol, D. (1999).Key Differences between HTTP/1.0 and HTTP/1.1. In “WWW8 Conference Refereed Papers”, Eighth International World Wide Web Conference, Toronto Convention Centre, Toronto, Canadá,11 a 14 de Maio, 1999.
http://bit.ly/oNhktc