The document is a presentation about turbocharging mobile web apps. It discusses caching assets like CSS and images to make pages load faster. It introduces ServiceWorkers as a new way to control caching without breaking the web. It also discusses using IndexedDB and libraries like PouchDB to cache app content and sync data offline. The key lessons are to cache the shell assets, cache app content separately using tools like IndexedDB, and use an existing library for data syncing across devices.
29. Shit you will do wrong
• Setting wrong MIME type
• Have one !le 404
• Not realizing user will always see old
version !rst
• Expiration headers on appcache
• Develop with appcache enabled
(tip: set wrong MIME type in dev)
63. Making it less naive
• Use indexedDB: http://nparashuram.com/IndexedDBShim/
• Wrap around current AJAX lib
• Expiration dates
• Of"ine -> ignore expiration date
67. It all depends
• Operational transform library. F.e. ShareJS
• Objects? F.e. https://github.com/codeparty/racer
• Real deal? PouchDB
68. Why I like PouchDB
1. It stores data locally, syncs when there is connection
2. Can do syncing client->server, server->client, or both ways
3. Con"ict resolution can be easily programmed out.
69. Why I like PouchDB
1. It stores data locally, syncs when there is connection
2. Can do syncing client->server, server->client, or both ways
3. Con"ict resolution can be easily programmed out.
4. Dale Harvey is gonna buy me beer
when I show him this slide
72. 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