working connected to create offline - trondheim developer conference 2014

48
Working connected to create offline Chris Heilmann, Trondheim Developer Conference, there, 24/11/2014

Upload: christian-heilmann

Post on 05-Dec-2014

1.622 views

Category:

Education


5 download

DESCRIPTION

One of the main problems that the web has is that it doesn’t work when you are offline. That’s one of the reasons why HTML5 is not the revolution that replaces native apps. In this talk Chris Heilmann of Mozilla shows just how much developers can benefit from working online and what you can do to ensure that the users of our products have a great offline experience. “Offline first” is a great principle, and we can use the web to achieve it.

TRANSCRIPT

Page 1: Working connected to create offline - Trondheim Developer Conference 2014

Working connected to create offline

Chris Heilmann, Trondheim Developer Conference, ← there, 24/11/2014

Page 2: Working connected to create offline - Trondheim Developer Conference 2014

We live in exciting times.

Page 3: Working connected to create offline - Trondheim Developer Conference 2014

Going online is not a thing anymore…

Page 4: Working connected to create offline - Trondheim Developer Conference 2014

Natural service integration

Page 5: Working connected to create offline - Trondheim Developer Conference 2014

Single location service aggregation

Page 6: Working connected to create offline - Trondheim Developer Conference 2014

Automatic updates and notifications

Page 7: Working connected to create offline - Trondheim Developer Conference 2014

Seamless data retention and syncing

Page 8: Working connected to create offline - Trondheim Developer Conference 2014

A steady stream of amazing data

Page 9: Working connected to create offline - Trondheim Developer Conference 2014

With us as consumers and creators

Page 10: Working connected to create offline - Trondheim Developer Conference 2014
Page 11: Working connected to create offline - Trondheim Developer Conference 2014
Page 12: Working connected to create offline - Trondheim Developer Conference 2014
Page 13: Working connected to create offline - Trondheim Developer Conference 2014

http://selfiebrush.com/

Page 14: Working connected to create offline - Trondheim Developer Conference 2014

Voice recognition and wearables

Page 15: Working connected to create offline - Trondheim Developer Conference 2014

oh…

Page 16: Working connected to create offline - Trondheim Developer Conference 2014

We live in exciting times.

Page 17: Working connected to create offline - Trondheim Developer Conference 2014

The future won’t have flying cars and limitless connectivity.

Page 18: Working connected to create offline - Trondheim Developer Conference 2014

Physics is still against us…

https://www.flickr.com/photos/52686644@N04/6304054115/ MokshaDolphin

Page 19: Working connected to create offline - Trondheim Developer Conference 2014

Geography is against us

Page 20: Working connected to create offline - Trondheim Developer Conference 2014

World Wide Web(ish)…

Page 22: Working connected to create offline - Trondheim Developer Conference 2014

Homegrown concerns…

Page 23: Working connected to create offline - Trondheim Developer Conference 2014

Can we trust what we don’t know?

Page 24: Working connected to create offline - Trondheim Developer Conference 2014

What is the cloud?

Page 25: Working connected to create offline - Trondheim Developer Conference 2014

Someone else’s computer.

Page 26: Working connected to create offline - Trondheim Developer Conference 2014

We are constantly being monitored.

Page 27: Working connected to create offline - Trondheim Developer Conference 2014

There’s a need for an offline web, but we conditioned people not to believe in it.

Page 28: Working connected to create offline - Trondheim Developer Conference 2014

https://www.youtube.com/watch?v=gnbLLQwZxeA

Page 29: Working connected to create offline - Trondheim Developer Conference 2014

http://removephotodata.com

Page 30: Working connected to create offline - Trondheim Developer Conference 2014

The current tools are OK(ish)…

Page 31: Working connected to create offline - Trondheim Developer Conference 2014

Offline apps - caching resources

http://caniuse.com/#search=appcache

Page 32: Working connected to create offline - Trondheim Developer Conference 2014

Offline apps - storing resources

http://caniuse.com/#search=webstorage

Page 33: Working connected to create offline - Trondheim Developer Conference 2014

Offline apps - storing larger resources

Page 34: Working connected to create offline - Trondheim Developer Conference 2014

We need to use them well, so that people start trusting the web to be offline capable and theirs to own.

Page 35: Working connected to create offline - Trondheim Developer Conference 2014

I am not alone in this…

https://www.youtube.com/watch?v=dPz_5-MEvcg

ALEX FEYERKE — OFFLINE FIRST

Page 36: Working connected to create offline - Trondheim Developer Conference 2014

We’re working on the solution…

Page 37: Working connected to create offline - Trondheim Developer Conference 2014

A great solution attempt: ServiceWorker

https://www.youtube.com/watch?v=4uQMl7mFB6g

Page 38: Working connected to create offline - Trondheim Developer Conference 2014

More in depth (with demos and all)

https://www.youtube.com/watch?v=SmZ9XcTpMS4

Page 39: Working connected to create offline - Trondheim Developer Conference 2014

In the meantime, prepare for the next challenge…

Page 40: Working connected to create offline - Trondheim Developer Conference 2014

Think offline first!

Page 41: Working connected to create offline - Trondheim Developer Conference 2014

Offline ideas…

• Store static, unchanged content using AppCache • Offer interfaces for users (“do you want to store

this for later?”) • Check battery status and remind people to store

instead of polling and storing. • Start with a very simple, easy to cache version

that loads more on demand. • Store resources locally (libraries, fonts, images)

Page 42: Working connected to create offline - Trondheim Developer Conference 2014

http://www.peterbe.com/plog/localforage-vs.-xhr

LocalForage vs. XHR experiment

Page 43: Working connected to create offline - Trondheim Developer Conference 2014

Be frugal with your resources.

Page 44: Working connected to create offline - Trondheim Developer Conference 2014

Put the web on a diet…• Slim down your dependencies - do you really

need bootstrap, jQuery and those huge hero images when the user is on a mobile?

• Think about icon fonts, sprites and other ways to reduce HTTP requests - anything you can collate into a single resource, you can cache.

• Are you using whole fonts when you only need a few chars? Do you need all the weights and versions of the font?

Page 45: Working connected to create offline - Trondheim Developer Conference 2014

Find extra fat and remove it!

https://www.youtube.com/watch?v=Qrzf1lsBMMw

Page 46: Working connected to create offline - Trondheim Developer Conference 2014

Find extra fat and remove it!

Page 47: Working connected to create offline - Trondheim Developer Conference 2014

We live in exciting times.Let’s make the web world-wide again