SlideShare a Scribd company logo
Turbocharge
your mobile web apps

Jan Jongboom
@janjongboom
Speed is awesome!
blah, blah, blah, caching,
blah, expiration headers, blah, blah,
image maps, blah, blah, combining css,
blah, blah, minifying, blah, blah,
blah
New tricks!
Didn’t even exist when “High Performance Websites” came out
@janjongboom
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
37%
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
Part 0: Core concepts
1. The shell
2. App content
The shell
• All assets
• Distribution through:
• App store
• Publish on web server
• Changes are costly
The shell
• All assets
• Distribution through:
• App store
• Publish on web server
• Changes are costly
App content
• Everything your app serves up
• Pushed down from server
• Highly volatile
• Changes are cheap
App content
• Everything your app serves up
• Pushed down from server
• Highly volatile
• Changes are cheap
Part I: The shell
Packaging
Packaging
Publishing on the web = awesome
AppCache: a more web’y approach
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
example.appcache

Serve as text/cache-manifest
example.appcache

Serve as text/cache-manifest
example.appcache

Serve as text/cache-manifest
How AppCache works
Develop:BBC 2013 - Turbocharge your mobile web apps by using offline
Shit you will do wrong
• Setting wrong MIME type
• Have one !le 404
• Not realizing user will always see old
version !rst
• Develop with appcache enabled
(tip: set wrong MIME type in dev)
http://comoyo.github.io/ffos-list-detail
Performance metrics

1500 ms
Empty cache
Performance metrics

820 ms
Subsequent reload
Performance metrics

320 ms
Reload with appcache
250% speed bump
Not just for of!ine
Sounds perfect, right?
1. It breaks the web
2. You’re not in control about caching
3. You’re not in control about
of!ine behavior
4. Responsive design is hard
Give developers "ne-grained
control about caching, without
breaking the web
ServiceWorkers
First request

Grabbing jan.com/index.html
ServiceWorkers
First request

Grabbing jan.com/index.html

For foo/* please consult me!
ServiceWorkers
2nd request

I need foo/blah
ServiceWorkers
2nd request

I need foo/blah
ServiceWorkers
2nd request

I need foo/blah

200 OK!
Example: registering
Example: registering
Example: registering
Example: use cache
Example: use cache
Example: use cache
Ongoing work in Gecko / Blink
Spec & playing around
https://github.com/slightlyoff/ServiceWorker
Part II: App content
A simple AJAX request
A simple AJAX request
A simple AJAX request
Naive caching with localStorage
Naive caching with localStorage
Naive caching with localStorage
Making it less naive
• Use indexedDB: http://nparashuram.com/IndexedDBShim/
• Wrap around current AJAX lib
• Expiration dates
• Of"ine -> ignore expiration date
Example: AngularJS/indexedDB

https://github.com/comoyo/ffos-list-detail/
blob/master/www/js/services/http-cache.js
Part IV: Lessons learned
Lessons learned
Lessons learned
• Of"ine is awesome, speed is awesome!
• Cache shell: packaging, appcache or ServiceWorkers
• Cache content: localStorage, indexedDB, write cache logic that
suits you
• Data syncing: hard, take something off the shelf
Thank you!

slideshare.net/janjongboom

More Related Content

PPTX
The WordPress REST API as a Springboard for Website Greatness
PPTX
Optimizing Your Site for Holiday Traffic
PDF
[GeekTalk#2] Takaaki Mizuno - Api Url Design
PPTX
Increasing Traffic Through Optimization : The Importance of Site Speed
PPTX
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
PPT
Windy cityrails performance_tuning
PDF
Office 365 vs. Google Apps
PPTX
MeteorJS Session
The WordPress REST API as a Springboard for Website Greatness
Optimizing Your Site for Holiday Traffic
[GeekTalk#2] Takaaki Mizuno - Api Url Design
Increasing Traffic Through Optimization : The Importance of Site Speed
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Windy cityrails performance_tuning
Office 365 vs. Google Apps
MeteorJS Session

What's hot (20)

PPTX
Ember Conf 2016: Building Mobile Apps with Ember
PDF
Lessons Learned from Using Next.js in Production
PPTX
Software that eats the world! - PerformDay Brussels
PDF
Way of the Future
PPTX
React BKK: Scalable Application Architecture
PPTX
Web Cache Deception Attack
PDF
Web, Native iOS and Native Android with One Ember.js App
PPTX
Building Browser Extensions with Ember
PPT
Building High Performance Web Applications
PPTX
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
PDF
Web application intro
PDF
Make Local WordPress Development Simple
PDF
Ember At Scale
PPTX
Localizing SharePoint: Adding Multi-language Support to Your Site
PDF
Demystifying Web Performance
PDF
Creating an Effective Mobile API
PDF
Building Faster Locally with Local - Ben Turner
PDF
The WP Engine Developer Experience. Increased agility, improved efficiency.
PDF
Snappy Means Happy: Performance in Ember Apps
PPT
Testing Any Site With Cucumber and Selenium
Ember Conf 2016: Building Mobile Apps with Ember
Lessons Learned from Using Next.js in Production
Software that eats the world! - PerformDay Brussels
Way of the Future
React BKK: Scalable Application Architecture
Web Cache Deception Attack
Web, Native iOS and Native Android with One Ember.js App
Building Browser Extensions with Ember
Building High Performance Web Applications
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
Web application intro
Make Local WordPress Development Simple
Ember At Scale
Localizing SharePoint: Adding Multi-language Support to Your Site
Demystifying Web Performance
Creating an Effective Mobile API
Building Faster Locally with Local - Ben Turner
The WP Engine Developer Experience. Increased agility, improved efficiency.
Snappy Means Happy: Performance in Ember Apps
Testing Any Site With Cucumber and Selenium
Ad

Similar to Develop:BBC 2013 - Turbocharge your mobile web apps by using offline (20)

PDF
VelocityConf EU 2013 - Turbocharge your mobile web apps by using offline
PDF
Offline of web applications
PDF
Offline for web - Frontend Dev Conf Minsk 2014
PDF
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
PPTX
JS digest. Decemebr 2017
PDF
7 Habits of Exceptional Performance
PDF
HTML5 for mobile - DiGi Challenge for Change
ODP
Cvcc performance tuning
PPTX
Progressive Web Apps - Overview & Getting Started
PDF
The 5 most common reasons for a slow WordPress site and how to fix them
PPTX
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
PDF
12-Step Program for Scaling Web Applications on PostgreSQL
PDF
Webapi
PPTX
Building JavaScript
PPTX
Orlando DNN Usergroup Pres 12/06/11
PDF
What is Nginx and Why You Should to Use it with Wordpress Hosting
PDF
Should you use HTML5 to build your product? The pros & cons of using current ...
PDF
Cache is keeping you from reaching the full potential as a developer (word ca...
PDF
20 tips for website performance
PDF
Amp your site an intro to accelerated mobile pages
VelocityConf EU 2013 - Turbocharge your mobile web apps by using offline
Offline of web applications
Offline for web - Frontend Dev Conf Minsk 2014
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
JS digest. Decemebr 2017
7 Habits of Exceptional Performance
HTML5 for mobile - DiGi Challenge for Change
Cvcc performance tuning
Progressive Web Apps - Overview & Getting Started
The 5 most common reasons for a slow WordPress site and how to fix them
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
12-Step Program for Scaling Web Applications on PostgreSQL
Webapi
Building JavaScript
Orlando DNN Usergroup Pres 12/06/11
What is Nginx and Why You Should to Use it with Wordpress Hosting
Should you use HTML5 to build your product? The pros & cons of using current ...
Cache is keeping you from reaching the full potential as a developer (word ca...
20 tips for website performance
Amp your site an intro to accelerated mobile pages
Ad

More from Jan Jongboom (20)

PDF
TinyML on Arduino - workshop
PDF
Intelligent Edge - Getting started with TinyML for industrial applications
PDF
Teaching your sensors new tricks with Machine Learning - Eta Compute webinar
PDF
Get started with TinyML - Embedded online conference
PDF
Adding intelligence to your LoRaWAN deployment - The Things Virtual Conference
PDF
Get started with TinyML - Hackster webinar 9 April 2020
PDF
Tiny intelligent computers and sensors - Open Hardware Event 2020
PDF
Teaching your sensors new tricks with Machine Learning - CENSIS Tech Summit 2019
PDF
Adding intelligence to your LoRaWAN devices - The Things Conference on tour
PDF
Machine learning on 1 square centimeter - Emerce Next 2019
PDF
Fundamentals of IoT - Data Science Africa 2019
PDF
17,000 contributions in 32K RAM - FOSS North 2019
PDF
Open Hours: Mbed Simulator
PDF
Efficient IoT solutions based on LoRaWAN, The Things Network and Mbed OS
PDF
Machine learning on 1 cm2 - Tweakers Dev Summit
PDF
Simulating LoRaWAN devices - LoRa Alliance AMM 2019
PDF
Develop with Mbed OS - The Things Conference 2019
PDF
Firmware Updates over LoRaWAN - The Things Conference 2019
PDF
Faster Device Development - GSMA @ CES 2019
PDF
Mbed LoRaWAN stack: a case study - LoRa Alliance AMM Tokyo
TinyML on Arduino - workshop
Intelligent Edge - Getting started with TinyML for industrial applications
Teaching your sensors new tricks with Machine Learning - Eta Compute webinar
Get started with TinyML - Embedded online conference
Adding intelligence to your LoRaWAN deployment - The Things Virtual Conference
Get started with TinyML - Hackster webinar 9 April 2020
Tiny intelligent computers and sensors - Open Hardware Event 2020
Teaching your sensors new tricks with Machine Learning - CENSIS Tech Summit 2019
Adding intelligence to your LoRaWAN devices - The Things Conference on tour
Machine learning on 1 square centimeter - Emerce Next 2019
Fundamentals of IoT - Data Science Africa 2019
17,000 contributions in 32K RAM - FOSS North 2019
Open Hours: Mbed Simulator
Efficient IoT solutions based on LoRaWAN, The Things Network and Mbed OS
Machine learning on 1 cm2 - Tweakers Dev Summit
Simulating LoRaWAN devices - LoRa Alliance AMM 2019
Develop with Mbed OS - The Things Conference 2019
Firmware Updates over LoRaWAN - The Things Conference 2019
Faster Device Development - GSMA @ CES 2019
Mbed LoRaWAN stack: a case study - LoRa Alliance AMM Tokyo

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Weekly Chronicles - August'25 Week I
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
KodekX | Application Modernization Development
NewMind AI Weekly Chronicles - August'25 Week I
The AUB Centre for AI in Media Proposal.docx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Programs and apps: productivity, graphics, security and other tools
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Building Integrated photovoltaic BIPV_UPV.pdf
Per capita expenditure prediction using model stacking based on satellite ima...

Develop:BBC 2013 - Turbocharge your mobile web apps by using offline