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/

Recommended for you

Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes

This document summarizes techniques for building scalable websites with Perl, including caching whole pages, chunks of HTML/data, and using job queuing. Caching helps performance by reducing workload and scalability by lowering database load. Large sites like Yahoo cache aggressively. Job queuing prevents overloading resources and keeps websites responsive under high demand by lining requests up in a queue.

perl
Performance in business terms
Performance in business termsPerformance in business terms
Performance in business terms

You know that performance is crucial to your company's success, but do the people in the corner office know this? You need to get the message across using the language they speak and targeting the goals they care about. This session -- presented by Strangeloop president Joshua Bixby at the 2011 Web Performance Summit -- summarizes the benefits of a faster website or web app, then delves into a series of how-tos for creating a business case for web performance in your organization.

performance optimizationweb performance summitwebsite performance
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it

WordPress search customization is a topic we at Seravo get asked about on a frequent basis. There are many different ways to customize the search, and customers understandably want to learn the best practices. The search can be customized quite easily with small changes on PHP code level, and by utilizing MariaDB database’s built-in search functionality. You can also choose a more robust way to do this, and build a new ElasticSearch server just for your case. These slides are from the webinar on January 14th, 2021: https://seravo.com/blog/webinar-search-function-and-how-to-customize-it/

wordpresswordpress peformancewordpress search
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

Recommended for you

Caching the uncacheable with Varnish - DevDays 2021
Caching the uncacheable with Varnish - DevDays 2021Caching the uncacheable with Varnish - DevDays 2021
Caching the uncacheable with Varnish - DevDays 2021

Slides for my "Caching the uncacheable with Varnish" presentation at DevDays 2021. See https://feryn.eu/speaking/caching-uncacheable-varnish-devdays-2021/ for more information

cachingcdnweb
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to EverythingWordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything

The document discusses various techniques for caching websites to improve performance. It covers full page caching plugins like WP Super Cache and W3 Total Cache. It also discusses ways to optimize web servers like Apache and Nginx, speed up PHP parsing, use memcache for generic data storage, implement opcode caching, and do fragment caching. The goal of these caching techniques is to serve cached static content instead of dynamically generating pages each time to improve load times and server efficiency.

wordcampann arborwordpress
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...

by @thoaud from WordCamp Nordic 2019. Introduction to The Performance First Workflow in WordPress.

wordpresswoocommerceperformance
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

Recommended for you

PyGotham 2014 Introduction to Profiling
PyGotham 2014 Introduction to ProfilingPyGotham 2014 Introduction to Profiling
PyGotham 2014 Introduction to Profiling

This document summarizes an introduction to profiling presentation. It discusses using the cProfile module to generate profile data and analyze it using tools like pstats. It also discusses using the results to identify bottlenecks by looking at exclusive time functions or walking down the call graph from inclusive time functions. Common optimizations mentioned include removing unnecessary work, using more efficient algorithms, batching I/O operations, database and SQL tuning, caching, and reducing code complexity.

python programming performance
Altitude SF 2017: The power of the network
Altitude SF 2017: The power of the networkAltitude SF 2017: The power of the network
Altitude SF 2017: The power of the network

Modern progressive web applications are complex pieces of software running in the browser. Fastly offers unparalleled control over the way the bytes fly from your servers to the user, enabling many of the features of advanced progressive web apps to truly shine. This talk will show how these latest web technologies can best take advantage of smarts in the network to deliver your web app at top speed.

cloud computingcdncloud
Composing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopComposing re-useable ETL on Hadoop
Composing re-useable ETL on Hadoop

The document discusses composing reusable extract-transform-load (ETL) processes on Hadoop. It covers the data science lifecycle of acquiring, analyzing and taking action on data. It states that 80% of work in data science is spent on acquiring and preparing data. The document then discusses using Cascading, an abstraction framework for building MapReduce jobs, to create reusable ETL processes that are linearly scalable and follow a single-purpose composable design.

mapreducehadoopcascading
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

Recommended for you

Site Performance Optimization for Joomla #jwc13
Site Performance Optimization for Joomla #jwc13Site Performance Optimization for Joomla #jwc13
Site Performance Optimization for Joomla #jwc13

It's easy to improve the speed of your Joomla website. Just follow the tips & tricks of this presentation about Site Performance Optimization. These are the slides used during the Joomla World Conference 2013 in Boston #jwc13

joomlasite speed optimizationspo
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013

The document discusses techniques for improving web performance, including reducing time to first byte, using content delivery networks and HTTP compression, caching resources, keeping connections alive and reducing request sizes. It also covers optimizing images, loading JavaScript asynchronously to avoid blocking, and prefetching content. The overall goal is to reduce page load times and improve user experience.

ecimercadolibreweb performance optimization wpo site speed fronte
AcornCache Presentation at Boston Ruby Group
AcornCache Presentation at Boston Ruby GroupAcornCache Presentation at Boston Ruby Group
AcornCache Presentation at Boston Ruby Group

The slides for my presentation at the March meeting of Boston ruby group on http proxy caching using rack middlware. Code is at github.com/acorncache/acorn-cache

rubyrackprogramming
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

Recommended for you

Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre

The document provides techniques and tools for improving web performance. It discusses how reducing response times can directly impact revenues and user experience. It then covers various ways to optimize the frontend, including reducing time to first byte through DNS optimization and caching, using content delivery networks, HTTP compression, keeping connections alive, parallel downloads, and prefetching. It also discusses optimizing images, JavaScript loading, and introducing new formats like WebP. The overall document aims to educate on measuring and enhancing web performance.

websitespeedoptimization
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup

I gave this talk on 4/27/11 at the Boston PHP Meetup Group. It covers both server side and client side optimizations, as well as monitoring tools and techniques.

phpweb developmentweb performance
Rest services caching
Rest services cachingRest services caching
Rest services caching

The document discusses caching strategies for REST services using HTTP. It explains the different states a resource representation can be in (up-to-date, fresh, stale) and caching directives like Cache-Control headers, expiration dates, and ETags that control caching and cache validation. Optimistic locking using ETags, If-Match, and If-None-Match is described as a way to handle concurrent data changes in a RESTful manner without transactions.

rest services caching
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 ...

Recommended for you

Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Android

The document discusses connecting Android applications to web services using HTTP, XML, JSON, and OAuth. It covers using the HttpClient API to make HTTP requests, parsing responses in XML and JSON formats, and obtaining access tokens from services using OAuth authentication. The document also recommends libraries for tasks like XML/JSON processing and provides examples of client libraries that connect to specific web services.

restjsonxml
WordPress Need For Speed
WordPress Need For SpeedWordPress Need For Speed
WordPress Need For Speed

WordPress performance can be improved by optimizing rendering speed and processing speed. Rendering speed focuses on front-end optimizations like minimizing page size through image optimization and concatenating/minifying scripts and stylesheets. Processing speed focuses on back-end optimizations like caching, using a CDN, adding expire headers, and leveraging reverse proxies and caching plugins. Nginx can be configured for caching, gzip compression, and load balancing to improve WordPress performance.

wordpresswordcampmtlspeed
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...

Traditionally, content delivery networks (CDNs) were known to accelerate static content. Amazon CloudFront has come a long way and now supports delivery of entire websites that include dynamic and static content. In this session, we introduce you to CloudFront’s dynamic delivery features that help improve the performance, scalability, and availability of your website while helping you lower your costs. We talk about architectural patterns such as SSL termination, close proximity connection termination, origin offload with keep-alive connections, and last-mile latency improvement. Also learn how to take advantage of Amazon Route 53's health check, automatic failover, and latency-based routing to build highly available web apps on AWS.

aws cloudparviz deyhim2014 aws summit san francisco
Thanks! Questions?
25

More Related Content

What's hot

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

What's hot (20)

Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes
 
Building Scalable Websites with Perl
Building Scalable Websites with PerlBuilding Scalable Websites with Perl
Building Scalable Websites with Perl
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 
Performance in business terms
Performance in business termsPerformance in business terms
Performance in business terms
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
 
Caching the uncacheable with Varnish - DevDays 2021
Caching the uncacheable with Varnish - DevDays 2021Caching the uncacheable with Varnish - DevDays 2021
Caching the uncacheable with Varnish - DevDays 2021
 
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to EverythingWordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
WordCamp Ann Arbor 2014: Site Caching, From Nothing to Everything
 
Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...Cache is keeping you from reaching the full potential as a developer (word ca...
Cache is keeping you from reaching the full potential as a developer (word ca...
 
PyGotham 2014 Introduction to Profiling
PyGotham 2014 Introduction to ProfilingPyGotham 2014 Introduction to Profiling
PyGotham 2014 Introduction to Profiling
 
Altitude SF 2017: The power of the network
Altitude SF 2017: The power of the networkAltitude SF 2017: The power of the network
Altitude SF 2017: The power of the network
 
Composing re-useable ETL on Hadoop
Composing re-useable ETL on HadoopComposing re-useable ETL on Hadoop
Composing re-useable ETL on Hadoop
 
Site Performance Optimization for Joomla #jwc13
Site Performance Optimization for Joomla #jwc13Site Performance Optimization for Joomla #jwc13
Site Performance Optimization for Joomla #jwc13
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
 
AcornCache Presentation at Boston Ruby Group
AcornCache Presentation at Boston Ruby GroupAcornCache Presentation at Boston Ruby Group
AcornCache Presentation at Boston Ruby Group
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP MeetupWeb Performance, Scalability, and Testing Techniques - Boston PHP Meetup
Web Performance, Scalability, and Testing Techniques - Boston PHP Meetup
 
Rest services caching
Rest services cachingRest services caching
Rest services caching
 
Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Android
 
WordPress Need For Speed
WordPress Need For SpeedWordPress Need For Speed
WordPress Need For Speed
 

Similar to Spreadshirt Techcamp 2018 - Hold until Told

Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Amazon Web Services
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Amazon Web Services
 
Altitude SF 2017: Optimizing your hit rate
Altitude SF 2017: Optimizing your hit rateAltitude SF 2017: Optimizing your hit rate
Altitude SF 2017: Optimizing your hit rate
Fastly
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
Craig Walker
 
Web Server SEO: Making your TTFB faster!
Web Server SEO: Making your TTFB faster!Web Server SEO: Making your TTFB faster!
Web Server SEO: Making your TTFB faster!
Ash New
 
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
nine
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
Roman Ananev
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
Amazon Web Services
 
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
SiteGround.com
 
Hacking Web Performance
Hacking Web Performance Hacking Web Performance
Hacking Web Performance
Maximiliano Firtman
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
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
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pages
Robert McFrazier
 
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger BartelWeb Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Holger Bartel
 
Tips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesTips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pages
Aditya Singh
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
guestb1b95b
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
Siarhei Barysiuk
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
Craig Walker
 
Super speed around the globe - SearchLeeds 2018
Super speed around the globe - SearchLeeds 2018Super speed around the globe - SearchLeeds 2018
Super speed around the globe - SearchLeeds 2018
Bastian Grimm
 
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
Branded3
 

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

Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
 
Altitude SF 2017: Optimizing your hit rate
Altitude SF 2017: Optimizing your hit rateAltitude SF 2017: Optimizing your hit rate
Altitude SF 2017: Optimizing your hit rate
 
Client Side Performance @ Xero
Client Side Performance @ XeroClient Side Performance @ Xero
Client Side Performance @ Xero
 
Web Server SEO: Making your TTFB faster!
Web Server SEO: Making your TTFB faster!Web Server SEO: Making your TTFB faster!
Web Server SEO: Making your TTFB faster!
 
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
Challenges behind the scenes of the large Swiss e-Commerce shop apfelkiste.ch...
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
 
MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...MeasureWorks - Why people hate to wait for your website to load (and how to f...
MeasureWorks - Why people hate to wait for your website to load (and how to f...
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
Hacking Web Performance
Hacking Web Performance Hacking Web Performance
Hacking Web Performance
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress Hosting
 
Amp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pagesAmp your site: An intro to accelerated mobile pages
Amp your site: An intro to accelerated mobile pages
 
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger BartelWeb Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
Web Performance in the Age of HTTP2 - Topconf Tallinn 2016 - Holger Bartel
 
Tips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pagesTips tricks deliver_high_performing_secure_web_pages
Tips tricks deliver_high_performing_secure_web_pages
 
Csdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer YahooCsdn Drdobbs Tenni Theurer Yahoo
Csdn Drdobbs Tenni Theurer Yahoo
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Building Faster Websites
Building Faster WebsitesBuilding Faster Websites
Building Faster Websites
 
Super speed around the globe - SearchLeeds 2018
Super speed around the globe - SearchLeeds 2018Super speed around the globe - SearchLeeds 2018
Super speed around the globe - SearchLeeds 2018
 
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
 

Recently uploaded

Corporate Minimal Newspaper Headline Style Newsletter.pptx
Corporate Minimal Newspaper Headline Style Newsletter.pptxCorporate Minimal Newspaper Headline Style Newsletter.pptx
Corporate Minimal Newspaper Headline Style Newsletter.pptx
byubyu7
 
Common Challenges in UI UX Design and How Services Can Help.pdf
Common Challenges in UI UX Design and How Services Can Help.pdfCommon Challenges in UI UX Design and How Services Can Help.pdf
Common Challenges in UI UX Design and How Services Can Help.pdf
Serva AppLabs
 
一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理
一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理
一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理
taqyea
 
Megalive99 Situs Betting Online Gacor Terpercaya
Megalive99 Situs Betting Online Gacor TerpercayaMegalive99 Situs Betting Online Gacor Terpercaya
Megalive99 Situs Betting Online Gacor Terpercaya
Megalive99
 
一比一原版(aber毕业证)亚伯大学毕业证如何办理
一比一原版(aber毕业证)亚伯大学毕业证如何办理一比一原版(aber毕业证)亚伯大学毕业证如何办理
一比一原版(aber毕业证)亚伯大学毕业证如何办理
taqyea
 
一比一原版(london毕业证书)英国伦敦大学毕业证如何办理
一比一原版(london毕业证书)英国伦敦大学毕业证如何办理一比一原版(london毕业证书)英国伦敦大学毕业证如何办理
一比一原版(london毕业证书)英国伦敦大学毕业证如何办理
taqyea
 
一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理
一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理
一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理
taqyea
 
How to Choose the Right UIUX Design Service for Optimal Customer Experience
How to Choose the Right UIUX Design Service for Optimal Customer ExperienceHow to Choose the Right UIUX Design Service for Optimal Customer Experience
How to Choose the Right UIUX Design Service for Optimal Customer Experience
Serva AppLabs
 
Carrington degree offer diploma Transcript
Carrington degree offer diploma TranscriptCarrington degree offer diploma Transcript
Carrington degree offer diploma Transcript
ubufe
 
2023. Archive - Gigabajtos selfpublisher homepage
2023. Archive - Gigabajtos selfpublisher homepage2023. Archive - Gigabajtos selfpublisher homepage
2023. Archive - Gigabajtos selfpublisher homepage
Zsolt Nemeth
 
一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理
一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理
一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理
taqyea
 
seo proposal | Kiyado Innovations LLP pdf
seo proposal | Kiyado Innovations LLP  pdfseo proposal | Kiyado Innovations LLP  pdf
seo proposal | Kiyado Innovations LLP pdf
diyakiyado
 
Founders Of Digital World Social Media..
Founders Of Digital World Social Media..Founders Of Digital World Social Media..
Founders Of Digital World Social Media..
jom pom
 
University of Otago degree offer diploma Transcript
University of Otago degree offer diploma TranscriptUniversity of Otago degree offer diploma Transcript
University of Otago degree offer diploma Transcript
ubufe
 
一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理
一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理
一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理
taqyea
 
一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理
一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理
一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理
taqyea
 
Book dating , international dating phgra
Book dating , international dating phgraBook dating , international dating phgra
Book dating , international dating phgra
thomaskurtha9
 
一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理
一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理
一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理
taqyea
 
Quiz Quiz Hota Hai (School Quiz 2018-19)
Quiz Quiz Hota Hai (School Quiz 2018-19)Quiz Quiz Hota Hai (School Quiz 2018-19)
Quiz Quiz Hota Hai (School Quiz 2018-19)
Kashyap J
 
202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...
202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...
202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...
ffg01100
 

Recently uploaded (20)

Corporate Minimal Newspaper Headline Style Newsletter.pptx
Corporate Minimal Newspaper Headline Style Newsletter.pptxCorporate Minimal Newspaper Headline Style Newsletter.pptx
Corporate Minimal Newspaper Headline Style Newsletter.pptx
 
Common Challenges in UI UX Design and How Services Can Help.pdf
Common Challenges in UI UX Design and How Services Can Help.pdfCommon Challenges in UI UX Design and How Services Can Help.pdf
Common Challenges in UI UX Design and How Services Can Help.pdf
 
一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理
一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理
一比一原版(kcl毕业证书)英国伦敦国王学院毕业证如何办理
 
Megalive99 Situs Betting Online Gacor Terpercaya
Megalive99 Situs Betting Online Gacor TerpercayaMegalive99 Situs Betting Online Gacor Terpercaya
Megalive99 Situs Betting Online Gacor Terpercaya
 
一比一原版(aber毕业证)亚伯大学毕业证如何办理
一比一原版(aber毕业证)亚伯大学毕业证如何办理一比一原版(aber毕业证)亚伯大学毕业证如何办理
一比一原版(aber毕业证)亚伯大学毕业证如何办理
 
一比一原版(london毕业证书)英国伦敦大学毕业证如何办理
一比一原版(london毕业证书)英国伦敦大学毕业证如何办理一比一原版(london毕业证书)英国伦敦大学毕业证如何办理
一比一原版(london毕业证书)英国伦敦大学毕业证如何办理
 
一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理
一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理
一比一原版(oregon毕业证书)俄勒冈大学毕业证如何办理
 
How to Choose the Right UIUX Design Service for Optimal Customer Experience
How to Choose the Right UIUX Design Service for Optimal Customer ExperienceHow to Choose the Right UIUX Design Service for Optimal Customer Experience
How to Choose the Right UIUX Design Service for Optimal Customer Experience
 
Carrington degree offer diploma Transcript
Carrington degree offer diploma TranscriptCarrington degree offer diploma Transcript
Carrington degree offer diploma Transcript
 
2023. Archive - Gigabajtos selfpublisher homepage
2023. Archive - Gigabajtos selfpublisher homepage2023. Archive - Gigabajtos selfpublisher homepage
2023. Archive - Gigabajtos selfpublisher homepage
 
一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理
一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理
一比一原版(ic毕业证书)英国帝国理工学院毕业证如何办理
 
seo proposal | Kiyado Innovations LLP pdf
seo proposal | Kiyado Innovations LLP  pdfseo proposal | Kiyado Innovations LLP  pdf
seo proposal | Kiyado Innovations LLP pdf
 
Founders Of Digital World Social Media..
Founders Of Digital World Social Media..Founders Of Digital World Social Media..
Founders Of Digital World Social Media..
 
University of Otago degree offer diploma Transcript
University of Otago degree offer diploma TranscriptUniversity of Otago degree offer diploma Transcript
University of Otago degree offer diploma Transcript
 
一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理
一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理
一比一原版美国休斯敦大学毕业证(uh毕业证书)如何办理
 
一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理
一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理
一比一原版(soas毕业证书)英国伦敦大学亚非学院毕业证如何办理
 
Book dating , international dating phgra
Book dating , international dating phgraBook dating , international dating phgra
Book dating , international dating phgra
 
一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理
一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理
一比一原版(brunel毕业证书)英国布鲁内尔大学毕业证如何办理
 
Quiz Quiz Hota Hai (School Quiz 2018-19)
Quiz Quiz Hota Hai (School Quiz 2018-19)Quiz Quiz Hota Hai (School Quiz 2018-19)
Quiz Quiz Hota Hai (School Quiz 2018-19)
 
202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...
202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...
202254.com全网最高清影视香蕉影视,热门电影推荐,热门电视剧在线观看,免费电影,电影在线,在线观看。球华人在线電視劇,免费点播,免费提供最新高清的...
 

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 ...