SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
Caching for the Mobile Web and
Macklemore's Thrift Shop
by @rubikzube
Sometimes I make poor decisions
The rest of the time
● I work on shutterstock.mobi
● Eventually needs to handle 100k
visits per day around the world
● Uses a handful of web servers
● That means serious caching
Caching means better performance
for users and servers
1. Make fewer requests
2. Fetch smaller resources
3. Travel shorter distances
4. Use generic pages that are cacheable
Don’t kill the servers
Do serve fast pages
Start by hunting for easy wins
● Use yslow and pagespeed to find ways to make fewer
requests and to fetch smaller resources
● Try to score in the high 80s - low 90s
● Minifying, concatenating, and gzipping is only the
first step
I’m, I’m hunting,
looking for a come up,
this is f*cking awesome
HTTP basics are important too
● HTTP is a core protocol of the internet
● HTTP headers determine how content will be cached
on the browser AND along the network
● If HTTP headers are set properly the browser will
travel shorter distances
Imma take your
grandpa’s style
Caching involves more than
a browser and a server
Reverse
Proxies
Web
Servers
Wireless
Towers
Optional
CDNs
Internet
Routers
Mobile
Device w/
Radio
Web
Browser
billions millions 100’s 100k’s a few handfula few
Peep game, come take a look
through my telescope
If headers are set correctly,
the network serves the pages
This isn’t a beer or basketball
Less hops is better
Reverse
Proxies
Web
Servers
Wireless
Towers
Optional
CDNs
Internet
Routers
Mobile
Device w/
Radio
Web
Browser
billions millions 100’s 100k’s a few handfula few
A brief example
● Cache-Control: public, max-age=31536000
● Date: Tue, 17 Sep 2013 01:59:24 GMT
● Expires: Wed, 17 Sep 2014 01:59:24 GMT
● Server: nginx
● ETag: "151472-1379361363000"
Savin' my money and I'm hella
happy that's a bargain, b*tch
Keep pages generic where possible
● Separate user-specific content from public pages at
the request level to make pages generic and
cacheable
Dressed in all pink
except my gator shoes,
those are green
Generic
User-Specific
The overall effect
Generic pages loaded from the network.
User-specific content follows from the
web server via AJAX.
Reverse
Proxies
Web
Servers
Wireless
Towers
Optional
CDNs
Internet
Routers
Mobile
Device w/
Radio
Web
Browser
billions millions 100’s 100k’s a few handfula few
● Any request caches generic pages in the network,
creating a pull effect
● The more users there are, the faster the site appears
to respond
● For layering in user-specific content via AJAX
○ Use different domains
○ Use the same domain and scope user-specific content (and
cookies) to a subdirectory
More generic pages means more caching
Don’t send cookies with generic pages.
EVER.
● Sending cookies with generic pages signals that the
response is not generic and should not be cached
Having the same one as six other people
in this club is a hella don’t
Everyone go visit TMZ right now
Raise your hand if you can identify
why it’s slow in this diagram
Reverse
Proxies
Web
Servers
Wireless
Towers
Optional
CDNs
Internet
Routers
Mobile
Device w/
Radio
Web
Browser
billions millions 100’s 100k’s a few handfula few
If the first page load is slow in the the forest,
and no one is around
● On first page load, there are too many variations in
mobile network connectivity to perceive whether the
site itself is slow
● I submit don’t optimize the first page load
● I submit the most important page load is the second
What you know about rockin' a wolf on your noggin?
What you knowin' about wearin' a fur fox skin?
Optimize for the second load
● Serve all JS/CSS/Icons for the site on every page with a
year-long cache expiry
● First Load: 297.3K 16 requests
● Homepage: 7.7K 1 request
● Login: 5.4K 1 request
● Search: 28.0K 1 request + images
As for performance impact:
Browsers get better all the time,
the network doesn’t
Questions?
Special shout out to @ShutterTech!
Keepin’ me honest since 2011

Weitere ähnliche Inhalte

Was ist angesagt?

Martin Splitt "A short history of the web"
Martin Splitt "A short history of the web"Martin Splitt "A short history of the web"
Martin Splitt "A short history of the web"Fwdays
 
CouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy serverCouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy servertkramar
 
[SoftServe IT Academy] - JavaScript Storages
[SoftServe IT Academy] - JavaScript Storages[SoftServe IT Academy] - JavaScript Storages
[SoftServe IT Academy] - JavaScript StoragesIvan Matiishyn
 
JMeter performance and scalability in Moodle Montana Moot 2014
JMeter performance and scalability in Moodle Montana Moot 2014JMeter performance and scalability in Moodle Montana Moot 2014
JMeter performance and scalability in Moodle Montana Moot 2014moorejon
 
Presentation slam the server with jMeter
Presentation slam the server with jMeterPresentation slam the server with jMeter
Presentation slam the server with jMeterNestor Mata Cuthbert
 

Was ist angesagt? (6)

Martin Splitt "A short history of the web"
Martin Splitt "A short history of the web"Martin Splitt "A short history of the web"
Martin Splitt "A short history of the web"
 
CouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy serverCouchDB: replicated data store for distributed proxy server
CouchDB: replicated data store for distributed proxy server
 
[SoftServe IT Academy] - JavaScript Storages
[SoftServe IT Academy] - JavaScript Storages[SoftServe IT Academy] - JavaScript Storages
[SoftServe IT Academy] - JavaScript Storages
 
JMeter performance and scalability in Moodle Montana Moot 2014
JMeter performance and scalability in Moodle Montana Moot 2014JMeter performance and scalability in Moodle Montana Moot 2014
JMeter performance and scalability in Moodle Montana Moot 2014
 
Presentation slam the server with jMeter
Presentation slam the server with jMeterPresentation slam the server with jMeter
Presentation slam the server with jMeter
 
Caching in WordPress
Caching in WordPressCaching in WordPress
Caching in WordPress
 

Andere mochten auch

Western Art & Architecture Summer/Fall 2011
Western Art & Architecture Summer/Fall 2011Western Art & Architecture Summer/Fall 2011
Western Art & Architecture Summer/Fall 2011knphoto
 
Commercial Portfolio
Commercial PortfolioCommercial Portfolio
Commercial Portfolioknphoto
 
Cowboys & Indians Magazine
Cowboys & Indians MagazineCowboys & Indians Magazine
Cowboys & Indians Magazineknphoto
 
Cabin in Big Sky
Cabin in Big SkyCabin in Big Sky
Cabin in Big Skyknphoto
 
Log Home Living
Log Home LivingLog Home Living
Log Home Livingknphoto
 
What's new in Team Foundation Server 2013
What's new in Team Foundation Server 2013What's new in Team Foundation Server 2013
What's new in Team Foundation Server 2013Jozua Velle
 
Big Sky Journal HOME 2009
Big Sky Journal HOME 2009Big Sky Journal HOME 2009
Big Sky Journal HOME 2009knphoto
 
Residential Portfolio
Residential PortfolioResidential Portfolio
Residential Portfolioknphoto
 
Distributed scrum
Distributed scrumDistributed scrum
Distributed scrumJozua Velle
 
Looking at geo tagging
Looking at geo taggingLooking at geo tagging
Looking at geo taggingraamt
 
Enough with the Ninja Shit
Enough with the Ninja ShitEnough with the Ninja Shit
Enough with the Ninja ShitZubin Tiku
 
Bouwplaatsveiligheid
BouwplaatsveiligheidBouwplaatsveiligheid
Bouwplaatsveiligheidsmid_jan
 
GIORNO 12
GIORNO 12GIORNO 12
GIORNO 124246sud
 
giorno 6
giorno 6giorno 6
giorno 64246sud
 
Application Lifecycle Management with Team Foundation Server
Application Lifecycle Management with Team Foundation ServerApplication Lifecycle Management with Team Foundation Server
Application Lifecycle Management with Team Foundation ServerJozua Velle
 
giorno 5
giorno 5giorno 5
giorno 54246sud
 

Andere mochten auch (20)

Western Art & Architecture Summer/Fall 2011
Western Art & Architecture Summer/Fall 2011Western Art & Architecture Summer/Fall 2011
Western Art & Architecture Summer/Fall 2011
 
Commercial Portfolio
Commercial PortfolioCommercial Portfolio
Commercial Portfolio
 
Cowboys & Indians Magazine
Cowboys & Indians MagazineCowboys & Indians Magazine
Cowboys & Indians Magazine
 
Cabin in Big Sky
Cabin in Big SkyCabin in Big Sky
Cabin in Big Sky
 
Log Home Living
Log Home LivingLog Home Living
Log Home Living
 
What's new in Team Foundation Server 2013
What's new in Team Foundation Server 2013What's new in Team Foundation Server 2013
What's new in Team Foundation Server 2013
 
Big Sky Journal HOME 2009
Big Sky Journal HOME 2009Big Sky Journal HOME 2009
Big Sky Journal HOME 2009
 
Residential Portfolio
Residential PortfolioResidential Portfolio
Residential Portfolio
 
Distributed scrum
Distributed scrumDistributed scrum
Distributed scrum
 
Brexit 24062016 jp
Brexit 24062016 jpBrexit 24062016 jp
Brexit 24062016 jp
 
Hecho relevante inkemia
Hecho relevante inkemiaHecho relevante inkemia
Hecho relevante inkemia
 
Looking at geo tagging
Looking at geo taggingLooking at geo tagging
Looking at geo tagging
 
DevOps
DevOpsDevOps
DevOps
 
BHV
BHVBHV
BHV
 
Enough with the Ninja Shit
Enough with the Ninja ShitEnough with the Ninja Shit
Enough with the Ninja Shit
 
Bouwplaatsveiligheid
BouwplaatsveiligheidBouwplaatsveiligheid
Bouwplaatsveiligheid
 
GIORNO 12
GIORNO 12GIORNO 12
GIORNO 12
 
giorno 6
giorno 6giorno 6
giorno 6
 
Application Lifecycle Management with Team Foundation Server
Application Lifecycle Management with Team Foundation ServerApplication Lifecycle Management with Team Foundation Server
Application Lifecycle Management with Team Foundation Server
 
giorno 5
giorno 5giorno 5
giorno 5
 

Ähnlich wie Caching for the Mobile Web and Macklemore's Thrift Shop

A Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIsA Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIsSascha Wenninger
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibrePablo Moretti
 
Website Performance
Website PerformanceWebsite Performance
Website PerformanceHugo Fonseca
 
Fine tuning Hybrid Mobile App
Fine tuning Hybrid Mobile AppFine tuning Hybrid Mobile App
Fine tuning Hybrid Mobile AppAllan Tan
 
Geographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application PerformanceGeographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application Performancekkjjkevin03
 
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...Holger Bartel
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slowdmethvin
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek editionChris Love
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applicationsChris Love
 
Improving frontend performance
Improving frontend performanceImproving frontend performance
Improving frontend performanceSagar Desarda
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinJonathan Hochman
 
Guide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdf
Guide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdfGuide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdf
Guide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdfpersuebusiness
 
NGINX for Application Delivery & Acceleration
NGINX for Application Delivery & AccelerationNGINX for Application Delivery & Acceleration
NGINX for Application Delivery & AccelerationNGINX, Inc.
 
Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015Dustin Nay
 
NU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web PerformanceNU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web PerformanceLee Roberson
 
Boston Web Performance Meetup: The Render Chain and You
Boston Web Performance Meetup: The Render Chain and YouBoston Web Performance Meetup: The Render Chain and You
Boston Web Performance Meetup: The Render Chain and Youmattringel
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedPromet Source
 

Ähnlich wie Caching for the Mobile Web and Macklemore's Thrift Shop (20)

A Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIsA Look at the Performance of SAP's Modern UIs
A Look at the Performance of SAP's Modern UIs
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 
Website Performance
Website PerformanceWebsite Performance
Website Performance
 
Fine tuning Hybrid Mobile App
Fine tuning Hybrid Mobile AppFine tuning Hybrid Mobile App
Fine tuning Hybrid Mobile App
 
Geographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application PerformanceGeographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application Performance
 
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
Web Performance in the Age of HTTP/2 - FEDay Conference, Guangzhou, China 19/...
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Web performance
Web performanceWeb performance
Web performance
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slow
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
 
Web performance optimization for modern web applications
Web performance optimization for modern web applicationsWeb performance optimization for modern web applications
Web performance optimization for modern web applications
 
Improving frontend performance
Improving frontend performanceImproving frontend performance
Improving frontend performance
 
Breaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites WinBreaking the Speed Limit: Faster Websites Win
Breaking the Speed Limit: Faster Websites Win
 
Guide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdf
Guide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdfGuide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdf
Guide 4 - How To Dramatically Speed Up Your Website Using A Caching Plugin.pdf
 
NGINX for Application Delivery & Acceleration
NGINX for Application Delivery & AccelerationNGINX for Application Delivery & Acceleration
NGINX for Application Delivery & Acceleration
 
Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015Site Speed Hacks: Open West 2015
Site Speed Hacks: Open West 2015
 
Large-Scale Web Scraping: An Ultimate Guide
Large-Scale Web Scraping: An Ultimate GuideLarge-Scale Web Scraping: An Ultimate Guide
Large-Scale Web Scraping: An Ultimate Guide
 
NU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web PerformanceNU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web Performance
 
Boston Web Performance Meetup: The Render Chain and You
Boston Web Performance Meetup: The Render Chain and YouBoston Web Performance Meetup: The Render Chain and You
Boston Web Performance Meetup: The Render Chain and You
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 

Kürzlich hochgeladen

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Kürzlich hochgeladen (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Caching for the Mobile Web and Macklemore's Thrift Shop

  • 1. Caching for the Mobile Web and Macklemore's Thrift Shop by @rubikzube
  • 2. Sometimes I make poor decisions
  • 3. The rest of the time ● I work on shutterstock.mobi ● Eventually needs to handle 100k visits per day around the world ● Uses a handful of web servers ● That means serious caching
  • 4. Caching means better performance for users and servers 1. Make fewer requests 2. Fetch smaller resources 3. Travel shorter distances 4. Use generic pages that are cacheable Don’t kill the servers Do serve fast pages
  • 5. Start by hunting for easy wins ● Use yslow and pagespeed to find ways to make fewer requests and to fetch smaller resources ● Try to score in the high 80s - low 90s ● Minifying, concatenating, and gzipping is only the first step I’m, I’m hunting, looking for a come up, this is f*cking awesome
  • 6. HTTP basics are important too ● HTTP is a core protocol of the internet ● HTTP headers determine how content will be cached on the browser AND along the network ● If HTTP headers are set properly the browser will travel shorter distances Imma take your grandpa’s style
  • 7. Caching involves more than a browser and a server Reverse Proxies Web Servers Wireless Towers Optional CDNs Internet Routers Mobile Device w/ Radio Web Browser billions millions 100’s 100k’s a few handfula few Peep game, come take a look through my telescope
  • 8. If headers are set correctly, the network serves the pages This isn’t a beer or basketball Less hops is better Reverse Proxies Web Servers Wireless Towers Optional CDNs Internet Routers Mobile Device w/ Radio Web Browser billions millions 100’s 100k’s a few handfula few
  • 9. A brief example ● Cache-Control: public, max-age=31536000 ● Date: Tue, 17 Sep 2013 01:59:24 GMT ● Expires: Wed, 17 Sep 2014 01:59:24 GMT ● Server: nginx ● ETag: "151472-1379361363000" Savin' my money and I'm hella happy that's a bargain, b*tch
  • 10. Keep pages generic where possible ● Separate user-specific content from public pages at the request level to make pages generic and cacheable Dressed in all pink except my gator shoes, those are green
  • 12. The overall effect Generic pages loaded from the network. User-specific content follows from the web server via AJAX. Reverse Proxies Web Servers Wireless Towers Optional CDNs Internet Routers Mobile Device w/ Radio Web Browser billions millions 100’s 100k’s a few handfula few
  • 13. ● Any request caches generic pages in the network, creating a pull effect ● The more users there are, the faster the site appears to respond ● For layering in user-specific content via AJAX ○ Use different domains ○ Use the same domain and scope user-specific content (and cookies) to a subdirectory More generic pages means more caching
  • 14. Don’t send cookies with generic pages. EVER. ● Sending cookies with generic pages signals that the response is not generic and should not be cached Having the same one as six other people in this club is a hella don’t
  • 15. Everyone go visit TMZ right now Raise your hand if you can identify why it’s slow in this diagram Reverse Proxies Web Servers Wireless Towers Optional CDNs Internet Routers Mobile Device w/ Radio Web Browser billions millions 100’s 100k’s a few handfula few
  • 16. If the first page load is slow in the the forest, and no one is around ● On first page load, there are too many variations in mobile network connectivity to perceive whether the site itself is slow ● I submit don’t optimize the first page load ● I submit the most important page load is the second What you know about rockin' a wolf on your noggin? What you knowin' about wearin' a fur fox skin?
  • 17. Optimize for the second load ● Serve all JS/CSS/Icons for the site on every page with a year-long cache expiry ● First Load: 297.3K 16 requests ● Homepage: 7.7K 1 request ● Login: 5.4K 1 request ● Search: 28.0K 1 request + images As for performance impact: Browsers get better all the time, the network doesn’t
  • 18. Questions? Special shout out to @ShutterTech! Keepin’ me honest since 2011