SlideShare a Scribd company logo
Hold until Told
Spreadshirt TechCamp 10/2018
Martin Breest
Using content tagging and purging
to get back control over
freshness of cached content at the edge
thereby improving performance and
resilience of your services
2
Why do we cache content with
Fastly at the edge anyway?
Comparison of uncached vs cached page load of
www.spreadshirt.com on desktop from London
4
Source: https://www.webpagetest.org/
Cached page starts ~1.5 seconds earlier to render
because of faster HTML delivery
5
Cached 1 second
Uncached 2.5 seconds
Source: https://www.webpagetest.org/
Without Fastly browser communicates with data center
in Dallas and retrieves uncached HTML
6
Data Center Dallas
Browser London
7644 km/ RTT ~105 ms for desktop
influences load time
>1000 ms page creation
influences wait time
Source: https://wondernetwork.com/pings/Dallas
With Fastly browser communicates with edge node in
London and retrieves cached HTML
7
Data Center Dallas +
Fastly Shield POP
Browser London +
Fastly Edge POP
RTT ~10 ms
-> >10 times faster
~20 ms cache page retrieval
-> >50 times faster
Source: https://wondernetwork.com/pings/Dallas
Distances in US are in general higher than in Europe
8
Dallas
Los Angeles
Seattle
New York
Miami
2703 km
RTT 52 ms
2235 km
RTT 43 ms
1991km
RTT 34 ms
1787km
RTT 29 ms
Frankfurt
Paris
477 km
RTT 17 ms
Source: https://wondernetwork.com/pings/Dallas
https://wondernetwork.com/pings/Frankfurt
Load and wait times are much lower with Fastly for
cached pages compared to uncached ones
9
Uncached Cached
Source: Catchpoint CDN vs Origin www.spreadshirt.com
Great! So why don‘t we cache
everything?
10
Area of tension between static and dynamic content
11
Dynamic Content Static Content
Type HTML, API data (JSON, XML)
User related content
CSS, JS, Images
Change Frequency Medium to High No or Low
Caching No Yes
Expiry Time Edge Node None High
Expiry Time Browser No or Low Medium to High
Control over Freshness High Low
Performance Low to Medium High
Resilience on Spikes Low High
Sometimes we sacrifice freshness to get better
performance and resilience
12
Low Expiry StrategyDynamic Content Static Content
Type HTML, API data (JSON,
XML)
User related content
HTML, API data
(JSON, XML)
CSS, JS, Images
Change Frequency Medium to High Medium No or Low
Caching No Yes Yes
Expiry Time Edge Node None Low to Medium High
Expiry Time Browser No or Low No or Low Medium to High
Control over Freshness High Low Low
Performance Low to Medium High High
Resilience on Spikes Low High High
Low expiry strategy is an exercise in your tolerance for
mistakes
13
„Using the low-expiry approach has never been an optimal
caching strategy since you sacrifice good caching to hopefully
minimize how long you may serve stale content. (Also, your
fingers probably really hurt from always keeping them crossed,
since choosing these low expiry times is essentially an exercise
in your tolerance for mistakes.)“
Hooman Beheshti, VP of Technology @ Fastly
Source: https://www.fastly.com/blog/leveraging-your-cdn-cache-uncacheable-content
Can‘t we just notify the cache if content
changes, like an inversion of control?
Good idea! Because most content is actually event-
driven!
15
Event-Driven ContentDynamic Content Static Content
Type HTML, API data (JSON,
XML)
User related content
HTML, API data
CSS, JS, Images
User related
content
CSS, JS, Images
Change Frequency Medium to High Low to Medium No or Low
Caching No Yes Yes
Expiry Time Edge Node None Medium High
Expiry Time Browser No or Low No or Low Medium to High
Purge on State Change No Yes No
Control over Freshness High High Low
Performance Low to Medium High High
Resilience on Spikes Low High High
How does it work? On first browser request content gets
cached with Fastly and subsequent requests get
delivered from cache.
16
Browser
Step 1 – Load homepage to cache:
R R
1. Request homepage 1.1. Request homepage
1.2. Cache homepage with
TTL of 24 houres
1.3. Cache homepage with
TTL of 60 seconds
Fastly Origin
Browser
Step 2 – A couple of seconds later ... deliver homepage from cache:
R
2. Request homepage
2.2. Get homepage from cache2.3. Cache homepage with
TTL of 60 seconds
Fastly
On state change origin uses Purge API to notify Fastly of
changes and subsequent request fetches new content
from origin.
17
Step 3 – A couple of hours later ... notify Fastly on homepage change:
R
3. Purge homepage
3.1. Mark homepage as stale or
delete homepage from cache
Step 4 – A few seconds later ... fetch latest homepage version from origin:
Fastly Origin
Browser
R R
4. Request homepage 4.1. Request homepage
4.2. Cache homepage with
TTL of 24 houres
4.3. Cache homepage with
TTL of 60 seconds
Fastly Origin
How does a purge request look like in Fastly?
18
Purge single entry
• PURGE https://www.spreadshirt.com
Purge all entries of a Fastly service (which handles www.spreadshirt.com for
example)
• POST https://api.fastly.com/service/SJ4xrdqVxxxxCFpF2FQ6i/purge_all
Request Header:
Fastly-Key: 05ce6d7d7293ebc35bb15135426d0000
Purges can easily be triggered from your application!
Thousands of purges can be triggered per minute!
Purges are really fast and run in ~150 ms!
Documentation: https://docs.fastly.com/api/purge
Got it! But what do I do in more a realistic
scenario with multiple resources involved?
19
Content tagging and tag-based purging to the rescue!
Content can be tagged with surrogate keys
• GET https://www.spreadshirt.com/hallowen+kids+premium+t-shirt-D1100053716?sellable=106995955 (article
detail page)
• GET https://image.spreadshirtmedia.com/image-
server/v1/mp/designs/1100053716,width=178,height=178/hallowen.png (design image)
• GET https://image.spreadshirtmedia.com/image-
server/v1/mp/products/T815A2MPA1659PT17X23Y24D1100053716S38/views/1,width=800,height=800,appeara
nceId=2,backgroundColor=E8E8E8,version=1516099426/hallowen-kids-premium-t-shirt.jpg (product image)
Response Header:
Surrogate-Key: d1100053716
Content can be purged using surrogate keys (tags)
• POST https://api.fastly.com/service/SU1Z0xxxxPaozGVKXdv0eY/purge
Request Header:
Surrogate-Key: d1100053716
Fastly-Key: 05ce6d4d7793ebc35bb15135426d0000
Documentation: https://docs.fastly.com/api/purge
And that is it!
21
Conclusion
22
• Fastly‘s Purge API with instant purge capabilities allows to avoid the low expiry
strategy and implement truly event-driven content, which allows to
 Cache dynamic content at edge nodes with medium expiry times
 Improve performance and resilience (and therefore user experience)
 Keep high control on content freshness (avoid stale data)
Is that all I need to know?
23
Actually, No!
24
• Implementing event-driven content, we also need to talk about
 State change triggers and how to implement them
 Revalidation between browser and edge node to keep traffic costs low
 Decomposition strategies to handle parts of a page with different change
policies
 Vary headers to deliver different cached content on the same URL
... but that is enough content for the next presentation ...
Thanks! Questions?
25

More Related Content

PDF
Keep the Web Fast
Chris Fetherston
 
PDF
Less and faster – Cache tips for WordPress developers
Seravo
 
PPTX
Web Performance Automation - NY Web Performance Meetup
Strangeloop
 
PDF
How to investigate and recover from a security breach in WordPress
Otto Kekäläinen
 
PDF
Use Xdebug to profile PHP
Seravo
 
PDF
WordPress Speed & Performance from Pagely's CTO
Lizzie Kardon
 
PDF
Introduction to performance tuning perl web applications
Perrin Harkins
 
PDF
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Otto Kekäläinen
 
Keep the Web Fast
Chris Fetherston
 
Less and faster – Cache tips for WordPress developers
Seravo
 
Web Performance Automation - NY Web Performance Meetup
Strangeloop
 
How to investigate and recover from a security breach in WordPress
Otto Kekäläinen
 
Use Xdebug to profile PHP
Seravo
 
WordPress Speed & Performance from Pagely's CTO
Lizzie Kardon
 
Introduction to performance tuning perl web applications
Perrin Harkins
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Otto Kekäläinen
 

What's hot (20)

ODP
Choosing a Web Architecture for Perl
Perrin Harkins
 
PDF
Care and feeding notes
Perrin Harkins
 
PDF
Building Scalable Websites with Perl
Perrin Harkins
 
PDF
Scalable talk notes
Perrin Harkins
 
PPTX
Performance in business terms
Strangeloop
 
PDF
Search in WordPress - how it works and howto customize it
Otto Kekäläinen
 
PDF
Caching the uncacheable with Varnish - DevDays 2021
Thijs Feryn
 
PDF
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
topher1kenobe
 
PDF
Cache is keeping you from reaching the full potential as a developer (word ca...
Thomas Audunhus
 
PDF
PyGotham 2014 Introduction to Profiling
Perrin Harkins
 
PDF
Altitude SF 2017: The power of the network
Fastly
 
KEY
Composing re-useable ETL on Hadoop
Paul Lam
 
PDF
Site Performance Optimization for Joomla #jwc13
Hans Kuijpers
 
PDF
Web performance mercadolibre - ECI 2013
Santiago Aimetta
 
PPTX
AcornCache Presentation at Boston Ruby Group
Vince DeVendra
 
PDF
Web performance optimization - MercadoLibre
Pablo Moretti
 
PPTX
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Jonathan Klein
 
PPT
Rest services caching
Sperasoft
 
PDF
Connecting to Web Services on Android
sullis
 
PDF
WordPress Need For Speed
pdeschen
 
Choosing a Web Architecture for Perl
Perrin Harkins
 
Care and feeding notes
Perrin Harkins
 
Building Scalable Websites with Perl
Perrin Harkins
 
Scalable talk notes
Perrin Harkins
 
Performance in business terms
Strangeloop
 
Search in WordPress - how it works and howto customize it
Otto Kekäläinen
 
Caching the uncacheable with Varnish - DevDays 2021
Thijs Feryn
 
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
topher1kenobe
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Thomas Audunhus
 
PyGotham 2014 Introduction to Profiling
Perrin Harkins
 
Altitude SF 2017: The power of the network
Fastly
 
Composing re-useable ETL on Hadoop
Paul Lam
 
Site Performance Optimization for Joomla #jwc13
Hans Kuijpers
 
Web performance mercadolibre - ECI 2013
Santiago Aimetta
 
AcornCache Presentation at Boston Ruby Group
Vince DeVendra
 
Web performance optimization - MercadoLibre
Pablo Moretti
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Jonathan Klein
 
Rest services caching
Sperasoft
 
Connecting to Web Services on Android
sullis
 
WordPress Need For Speed
pdeschen
 
Ad

Similar to Spreadshirt Techcamp 2018 - Hold until Told (20)

PDF
Altitude SF 2017: Optimizing your hit rate
Fastly
 
PPT
Client Side Performance @ Xero
Craig Walker
 
PPTX
Web Server SEO: Making your TTFB faster!
Ash New
 
PDF
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
nine
 
PDF
Website & Internet + Performance testing
Roman Ananev
 
PDF
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks
 
PPTX
Joomla! Performance on Steroids
SiteGround.com
 
PDF
Hacking Web Performance
Maximiliano Firtman
 
PDF
What is Nginx and Why You Should to Use it with Wordpress Hosting
WPSFO Meetup Group
 
PDF
Amp your site: An intro to accelerated mobile pages
Robert McFrazier
 
PDF
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Holger Bartel
 
PDF
Tips tricks deliver_high_performing_secure_web_pages
Aditya Singh
 
PPT
Csdn Drdobbs Tenni Theurer Yahoo
guestb1b95b
 
PDF
High Performance Ajax Applications
Siarhei Barysiuk
 
PPTX
Building Faster Websites
Craig Walker
 
PDF
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
Branded3
 
PDF
Super speed around the globe - SearchLeeds 2018
Bastian Grimm
 
PDF
implement lighthouse-ci with your web development workflow
WordPress
 
PDF
Web Server SEO: Make your TTFB faster!
Ash New
 
PPTX
SEO 101 - Google Page Speed Insights Explained
Steve Weber
 
Altitude SF 2017: Optimizing your hit rate
Fastly
 
Client Side Performance @ Xero
Craig Walker
 
Web Server SEO: Making your TTFB faster!
Ash New
 
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
nine
 
Website & Internet + Performance testing
Roman Ananev
 
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks
 
Joomla! Performance on Steroids
SiteGround.com
 
Hacking Web Performance
Maximiliano Firtman
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
WPSFO Meetup Group
 
Amp your site: An intro to accelerated mobile pages
Robert McFrazier
 
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Holger Bartel
 
Tips tricks deliver_high_performing_secure_web_pages
Aditya Singh
 
Csdn Drdobbs Tenni Theurer Yahoo
guestb1b95b
 
High Performance Ajax Applications
Siarhei Barysiuk
 
Building Faster Websites
Craig Walker
 
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
Branded3
 
Super speed around the globe - SearchLeeds 2018
Bastian Grimm
 
implement lighthouse-ci with your web development workflow
WordPress
 
Web Server SEO: Make your TTFB faster!
Ash New
 
SEO 101 - Google Page Speed Insights Explained
Steve Weber
 
Ad

Recently uploaded (20)

PPTX
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
PDF
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
PPTX
nagasai stick diagrams in very large scale integratiom.pptx
manunagapaul
 
PPTX
How tech helps people in the modern era.
upadhyayaryan154
 
PPTX
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
PPTX
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
PPTX
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
PPTX
PPT_M4.3_WORKING WITH SLIDES APPLIED.pptx
MCEAMONVILLAVER
 
PDF
Cybersecurity Awareness Presentation ppt.
banodhaharshita
 
PDF
BGP Security Best Practices that Matter, presented at PHNOG 2025
APNIC
 
PDF
Centralized Business Email Management_ How Admin Controls Boost Efficiency & ...
XgenPlus Technologies
 
PPTX
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
dagarabull
 
PPTX
Unlocking Hope : How Crypto Recovery Services Can Reclaim Your Lost Funds
lionsgate network
 
PPTX
ENCOR_Chapter_11 - ‌BGP implementation.pptx
nshg93
 
PPTX
Black Yellow Modern Minimalist Elegant Presentation.pptx
nothisispatrickduhh
 
PPT
Transformaciones de las funciones elementales.ppt
rirosel211
 
PPTX
The Latest Scam Shocking the USA in 2025.pptx
onlinescamreport4
 
PPTX
Crypto Recovery California Services.pptx
lionsgate network
 
PPT
Introduction to dns domain name syst.ppt
MUHAMMADKAVISHSHABAN
 
Google SGE SEO: 5 Critical Changes That Could Wreck Your Rankings in 2025
Reversed Out Creative
 
Latest Scam Shocking the USA in 2025.pdf
onlinescamreport4
 
KIPER4D situs Exclusive Game dari server Star Gaming Asia
hokimamad0
 
nagasai stick diagrams in very large scale integratiom.pptx
manunagapaul
 
How tech helps people in the modern era.
upadhyayaryan154
 
Blue and Dark Blue Modern Technology Presentation.pptx
ap177979
 
B2B_Ecommerce_Internship_Simranpreet.pptx
LipakshiJindal
 
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
PPT_M4.3_WORKING WITH SLIDES APPLIED.pptx
MCEAMONVILLAVER
 
Cybersecurity Awareness Presentation ppt.
banodhaharshita
 
BGP Security Best Practices that Matter, presented at PHNOG 2025
APNIC
 
Centralized Business Email Management_ How Admin Controls Boost Efficiency & ...
XgenPlus Technologies
 
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
dagarabull
 
Unlocking Hope : How Crypto Recovery Services Can Reclaim Your Lost Funds
lionsgate network
 
ENCOR_Chapter_11 - ‌BGP implementation.pptx
nshg93
 
Black Yellow Modern Minimalist Elegant Presentation.pptx
nothisispatrickduhh
 
Transformaciones de las funciones elementales.ppt
rirosel211
 
The Latest Scam Shocking the USA in 2025.pptx
onlinescamreport4
 
Crypto Recovery California Services.pptx
lionsgate network
 
Introduction to dns domain name syst.ppt
MUHAMMADKAVISHSHABAN
 

Spreadshirt Techcamp 2018 - Hold until Told

  • 1. Hold until Told Spreadshirt TechCamp 10/2018 Martin Breest
  • 2. Using content tagging and purging to get back control over freshness of cached content at the edge thereby improving performance and resilience of your services 2
  • 3. Why do we cache content with Fastly at the edge anyway?
  • 4. Comparison of uncached vs cached page load of www.spreadshirt.com on desktop from London 4 Source: https://www.webpagetest.org/
  • 5. Cached page starts ~1.5 seconds earlier to render because of faster HTML delivery 5 Cached 1 second Uncached 2.5 seconds Source: https://www.webpagetest.org/
  • 6. Without Fastly browser communicates with data center in Dallas and retrieves uncached HTML 6 Data Center Dallas Browser London 7644 km/ RTT ~105 ms for desktop influences load time >1000 ms page creation influences wait time Source: https://wondernetwork.com/pings/Dallas
  • 7. With Fastly browser communicates with edge node in London and retrieves cached HTML 7 Data Center Dallas + Fastly Shield POP Browser London + Fastly Edge POP RTT ~10 ms -> >10 times faster ~20 ms cache page retrieval -> >50 times faster Source: https://wondernetwork.com/pings/Dallas
  • 8. Distances in US are in general higher than in Europe 8 Dallas Los Angeles Seattle New York Miami 2703 km RTT 52 ms 2235 km RTT 43 ms 1991km RTT 34 ms 1787km RTT 29 ms Frankfurt Paris 477 km RTT 17 ms Source: https://wondernetwork.com/pings/Dallas https://wondernetwork.com/pings/Frankfurt
  • 9. Load and wait times are much lower with Fastly for cached pages compared to uncached ones 9 Uncached Cached Source: Catchpoint CDN vs Origin www.spreadshirt.com
  • 10. Great! So why don‘t we cache everything? 10
  • 11. Area of tension between static and dynamic content 11 Dynamic Content Static Content Type HTML, API data (JSON, XML) User related content CSS, JS, Images Change Frequency Medium to High No or Low Caching No Yes Expiry Time Edge Node None High Expiry Time Browser No or Low Medium to High Control over Freshness High Low Performance Low to Medium High Resilience on Spikes Low High
  • 12. Sometimes we sacrifice freshness to get better performance and resilience 12 Low Expiry StrategyDynamic Content Static Content Type HTML, API data (JSON, XML) User related content HTML, API data (JSON, XML) CSS, JS, Images Change Frequency Medium to High Medium No or Low Caching No Yes Yes Expiry Time Edge Node None Low to Medium High Expiry Time Browser No or Low No or Low Medium to High Control over Freshness High Low Low Performance Low to Medium High High Resilience on Spikes Low High High
  • 13. Low expiry strategy is an exercise in your tolerance for mistakes 13 „Using the low-expiry approach has never been an optimal caching strategy since you sacrifice good caching to hopefully minimize how long you may serve stale content. (Also, your fingers probably really hurt from always keeping them crossed, since choosing these low expiry times is essentially an exercise in your tolerance for mistakes.)“ Hooman Beheshti, VP of Technology @ Fastly Source: https://www.fastly.com/blog/leveraging-your-cdn-cache-uncacheable-content
  • 14. Can‘t we just notify the cache if content changes, like an inversion of control?
  • 15. Good idea! Because most content is actually event- driven! 15 Event-Driven ContentDynamic Content Static Content Type HTML, API data (JSON, XML) User related content HTML, API data CSS, JS, Images User related content CSS, JS, Images Change Frequency Medium to High Low to Medium No or Low Caching No Yes Yes Expiry Time Edge Node None Medium High Expiry Time Browser No or Low No or Low Medium to High Purge on State Change No Yes No Control over Freshness High High Low Performance Low to Medium High High Resilience on Spikes Low High High
  • 16. How does it work? On first browser request content gets cached with Fastly and subsequent requests get delivered from cache. 16 Browser Step 1 – Load homepage to cache: R R 1. Request homepage 1.1. Request homepage 1.2. Cache homepage with TTL of 24 houres 1.3. Cache homepage with TTL of 60 seconds Fastly Origin Browser Step 2 – A couple of seconds later ... deliver homepage from cache: R 2. Request homepage 2.2. Get homepage from cache2.3. Cache homepage with TTL of 60 seconds Fastly
  • 17. On state change origin uses Purge API to notify Fastly of changes and subsequent request fetches new content from origin. 17 Step 3 – A couple of hours later ... notify Fastly on homepage change: R 3. Purge homepage 3.1. Mark homepage as stale or delete homepage from cache Step 4 – A few seconds later ... fetch latest homepage version from origin: Fastly Origin Browser R R 4. Request homepage 4.1. Request homepage 4.2. Cache homepage with TTL of 24 houres 4.3. Cache homepage with TTL of 60 seconds Fastly Origin
  • 18. How does a purge request look like in Fastly? 18 Purge single entry • PURGE https://www.spreadshirt.com Purge all entries of a Fastly service (which handles www.spreadshirt.com for example) • POST https://api.fastly.com/service/SJ4xrdqVxxxxCFpF2FQ6i/purge_all Request Header: Fastly-Key: 05ce6d7d7293ebc35bb15135426d0000 Purges can easily be triggered from your application! Thousands of purges can be triggered per minute! Purges are really fast and run in ~150 ms! Documentation: https://docs.fastly.com/api/purge
  • 19. Got it! But what do I do in more a realistic scenario with multiple resources involved? 19
  • 20. Content tagging and tag-based purging to the rescue! Content can be tagged with surrogate keys • GET https://www.spreadshirt.com/hallowen+kids+premium+t-shirt-D1100053716?sellable=106995955 (article detail page) • GET https://image.spreadshirtmedia.com/image- server/v1/mp/designs/1100053716,width=178,height=178/hallowen.png (design image) • GET https://image.spreadshirtmedia.com/image- server/v1/mp/products/T815A2MPA1659PT17X23Y24D1100053716S38/views/1,width=800,height=800,appeara nceId=2,backgroundColor=E8E8E8,version=1516099426/hallowen-kids-premium-t-shirt.jpg (product image) Response Header: Surrogate-Key: d1100053716 Content can be purged using surrogate keys (tags) • POST https://api.fastly.com/service/SU1Z0xxxxPaozGVKXdv0eY/purge Request Header: Surrogate-Key: d1100053716 Fastly-Key: 05ce6d4d7793ebc35bb15135426d0000 Documentation: https://docs.fastly.com/api/purge
  • 21. And that is it! 21
  • 22. Conclusion 22 • Fastly‘s Purge API with instant purge capabilities allows to avoid the low expiry strategy and implement truly event-driven content, which allows to  Cache dynamic content at edge nodes with medium expiry times  Improve performance and resilience (and therefore user experience)  Keep high control on content freshness (avoid stale data)
  • 23. Is that all I need to know? 23
  • 24. Actually, No! 24 • Implementing event-driven content, we also need to talk about  State change triggers and how to implement them  Revalidation between browser and edge node to keep traffic costs low  Decomposition strategies to handle parts of a page with different change policies  Vary headers to deliver different cached content on the same URL ... but that is enough content for the next presentation ...