Video and slides synchronized, mp3 and slide download available at http://bit.ly/YKORol.
Tim Stokes discusses various URI caching strategies providing real life examples relying on some of the natural behaviors that are built into the HTTP 1.1 protocol. Filmed at qconsf.com.
Tim Stokes is the Applications Architect at FamilySearch.org, a not for profit organization that provides free resources for people to research their family tree. Prior to FamilySearch, Tim worked in London and Sydney with a number of companies including BT, Citigroup, Royal and SunAlliance, Press Co, Prudential, GM Vauxhall, The London Stock Exchange, Qantas, AMP and Intuit Australia.
2. Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/Caching-Hypermedia-API
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
3. Presented at QCon San Francisco
www.qconsf.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
4. A very brief history
of Hypermedia
The Big Bang, 13.75 Billion Years Ago
26. GET /lamp/1
1
POST /lamp/1 1
power=on
GET /lamps
links… /lamp/1, /lamp/2, /lamp/3, /lamp/4,
/lamp/5, /lamp/6, etc…
GET /all-on-lamps
5
1
3
27. RESOURCE DESIGN NOTES:
• The URI should not carry state
• Symmetry between state in and out
• One way to get each piece
of state
• Beware of Summaries
and Bundles
29. GET /box
Accept-Language: EN
SYSTEM
box
Cache-Control: max-age=3600
Vary: Accept-Language
GET /box
Accept-Language: FR
boîte
Cache-Control: max-age=3600
Vary: Accept-Language
38. Relying on these Caching
Behaviors in Practice
• Compliance to HTTP 1.1
• Interpretation of HTTP 1.1
• Implementation variance
• Intermediaries
39. Approach
and granularity
• Design the shape
of your resources carefully.
• Target TTL in the Agent first for
best natural caching invalidation.
• Use, per request, Agent other
request header to trigger caching
strategies.
• ETags as second level after TTL.