Contenu connexe Similaire à HTTP colon slash slash: the end of the road? (20) Plus de Alessandro Nadalin (20) HTTP colon slash slash: the end of the road?14. verbs
They need rules.
15. verbs
They need rules.
domains
16. verbs
They need rules.
workflows
domains
17. verbs
logic
They need rules.
workflows
domains
18. verbs
logic
They need rules.
constraints
workflows
domains
23. 1996 GET
Tim Berners-Lee
POST
separate connections
HEAD Roy Fielding
25. PUT
Tim Berners-Lee 1996 GET
TRACE
Domain Application Protocol
PATCH
POST Roy Fielding
separate connections DELET
OPTIONS
HEAD
E
DIFF
26. EXPIRES MAX-AGE
CACHE CHANNELS
CACHE 304 Not modified
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
SCALABILITY
27. <feed xmlns="http://www.w3.org/2005/Atom"
xmlns:cc="http://purl.org/syndication/cache-channel">
<title>Invalidations for www.example.org</title>
<id>http://admin.example.org/events/</id>
<link rel="self"
href="http://admin.example.org/events/current"/>
<link rel="prev-archive"
href="http://admin.example.org/events/archive/1234"/>
<updated>2007-04-13T11:23:42Z</updated>
<author>
<name>Administrator</name>
<email>web-admin@example.org</email>
</author>
<cc:precision>60</cc:precision>
<cc:lifetime>2592000</cc:lifetime>
<entry>
<title>stale</title>
<id>http://admin.example.org/events/1124</id>
<updated>2007-04-13T11:23:42Z</updated>
<link href="urn:uuid:50D3565C-97A8-40E1-A5C8-CFA070166FEF"/>
<cc:stale/>
</entry>
<entry>
<title>stale</title>
<id>http://admin.example.org/events/1125</id>
<updated>2007-04-13T10:31:01Z</updated>
<link href="http://www.example.org/img/123.gif" type="image/gif"/>
<link href="http://www.example.org/img/123.png" type="image/png"/>
<cc:stale/>
</entry>
28. GET /users/1 HTTP/1.1 200 Ok
HTTP/1.1 Etag: 123abc
Host: example.com
GET /users/1 HTTP/1.1 HTTP/1.1 304 Not
Host: example.com Modified
If-None-Match: 123abc
POST /users/1 HTTP/1.1 HTTP/1.1 412
Host: example.com Precondition Failed
Etag: 123abcdefgh
...
29. GET /users/1 HTTP/1.1 HTTP/1.1 200 Ok
Host: example.com Cache-Control: max-age=60
GET /users/1 HTTP/1.1
Host: example.com
31. and here are a few ways to do
so, using
expiration
validation
invalidation
39. GET / HTTP/1.1
Host: www.example.com
Cache-Control: max-age=60, public
Cacheable by both local and shared caches
40. GET / HTTP/1.1
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
41. GET / HTTP/1.1
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
fault-tolerant
42. GET / HTTP/1.1
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
available during downtime
43. GET / HTTP/1.1
Host: www.example.com
Cache-Control: stale-if-error=600, stale-while-revalidate=600
available during revalidation
46. GET / HTTP/1.1
Host: www.example.
com
Etag: 1234
an identifier for your response
47. Conditional requests
GET / HTTP/1.1
Host: www.example.
com
If-None-Match: 1234
the browsers asks you if it has been modified
52. GET / HTTP/1.1
Host: www.example.com
Last-Modified: Tue, 15 Jan 2011 12:00:00 GMT
tell the client about the latest change
53. Conditional requests
GET / HTTP/1.1
Host: www.example.com
If-Modified-Since: Tue, 15 Jan 2011 12:00:00 GMT
the client asks you if it has been modified since the last time
58. The web is not meant for invalidating data.
Server should not be able to keep clients' state, otherwise
they wont scale well.
That's why long-polling and endless connections haven't
had big success dealing with caching.
60. HTTP's cache fails when dealing with really dynamic
pages, because consumers will always have to hit the
origin server, although a part of the page would be
cacheable ( header and footer, for example )
70. because caching is bound to the protocol, HTTP,
not to your implementation ( Sf, RoR, Django )
99. Client Server
Multiplexing
100. Client Server
Multiplexing
101. Client Server
Multiplexing
115. SPDY doesnt change the protocol,
it just changes the way messages are
exchanged over the wire