Skip to content

Commit d66d217

Browse files
committed
Storage, caching, notifications, app shell, web app manifest
1 parent a2aa934 commit d66d217

File tree

6 files changed

+154
-1
lines changed

6 files changed

+154
-1
lines changed

index.html

Lines changed: 154 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,50 @@ <h3>AppCache lottery</h3>
287287
</section>
288288

289289

290+
<!--https://www.html5rocks.com/en/tutorials/offline/storage/-->
291+
<section>
292+
<h2>Web storage</h2>
293+
<h3>localStorage</h3>
294+
<ul class="no-bullets">
295+
<li>Storing smaller amounts of data</li>
296+
<li>Single persistent object called localStorage</li>
297+
<li>NoSQL key-value store</li>
298+
<li>Sync API</li>
299+
<li>Poor performance for complex data</li>
300+
</ul>
301+
<h3>sessionStorage</h3>
302+
<ul class="no-bullets">
303+
<li>similar to localStorage</li>
304+
<li>cleans when window/tab closed</li>
305+
</ul>
306+
</section>
307+
308+
<section>
309+
<h3>IndexedDB</h3>
310+
<ul class="no-bullets">
311+
<li>Low-level API for client-side storage</li>
312+
<li>For significant amounts of structured data</li>
313+
<li>High performance searches of this data</li>
314+
<li>Transactional database system</li>
315+
<li>JavaScript-based object-oriented database</li>
316+
<li>Operations done async</li>
317+
<li>Famous from complex API</li>
318+
</ul>
319+
</section>
320+
321+
<section>
322+
<h3>'Cache' interface</h3>
323+
<ul class="no-bullets">
324+
<li>Storage mechanism for Request / Response object pairs</li>
325+
<li>Exposed to window and workers</li>
326+
<li>Items do not get updated unless explicitly requested</li>
327+
<li>Items don’t expire unless deleted</li>
328+
<li>Origin can have multiple, named Cache objects</li>
329+
<li>You as a dev need to purge Cache entries</li>
330+
</ul>
331+
</section>
332+
333+
290334

291335
<section data-background-color="var(--secondary-color)">
292336
<h1 style="font-size: 2.0em; margin-bottom: 0.5em;" class="fallbackColor" >Service Workers</h1>
@@ -593,8 +637,117 @@ <h1 style="font-size: 3.0em;" class="fallbackColor" >Can we use <a href="https:/
593637
</section>
594638

595639

596-
640+
<section>
641+
<h1>Push Notifications</h1>
642+
<img class="plain" style="max-height: 12em;" src="/src/img/cc-good.png">
643+
<p>
644+
<a href="https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/" class="credits" target="_blank">Image from Google Web Fundamentals</a>
645+
</p>
646+
</section>
647+
648+
649+
<section>
650+
<h1 style="font-size: 2,5em; margin-bottom: 0em;" class="fallbackColor" >Application</h1>
651+
<h1 style="font-size: 4.5em; margin-bottom: 0em;" class="secondaryColor" >shell</h1>
652+
<h1 style="font-size: 2.4em;" class="primaryColor" >architecture</h1>
653+
</section>
654+
655+
656+
<section>
657+
<img class="plain" style="max-height: 12em;" src="/src/img/appshell-1.jpg">
658+
<p>
659+
<a href="https://developers.google.com/web/updates/2015/11/app-shell" class="credits" target="_blank">Image from Google Web Updates</a>
660+
</p>
661+
</section>
662+
663+
<section>
664+
<h3>Application shell should:</h3>
665+
<ul>
666+
<li>load fast</li>
667+
<li>be cached</li>
668+
<li>dynamically display content</li>
669+
<li>be a replacment for bundles publishe din store for native apps</li>
670+
</ul>
671+
</section>
672+
673+
674+
<section>
675+
<h3>Web App Install Banner</h3>
676+
<img class="plain" style="max-height: 12em;" src="/src/img/add-to-home-screen.gif">
677+
<p>
678+
<a href="https://developers.google.com/web/fundamentals/engage-and-retain/app-install-banners/" class="credits" target="_blank">Image from Google Web Fundamentals</a>
679+
</p>
680+
</section>
681+
682+
<section>
683+
<h3>Web Banner criteria</h3>
684+
<ul>
685+
<li>Has a web app manifest</li>
686+
<li>Has a service worker registered</li>
687+
<li>Is served over HTTPS</li>
688+
<li>Is visited at least twice, with at least five minutes between visits</li>
689+
</ul>
690+
</section>
691+
692+
693+
<section>
694+
<h3>Sample manifest.json</h3>
695+
<pre><code class="javascript" data-trim data-noescape>
696+
{
697+
"short_name": "AirHorner",
698+
"name": "Kinlan's AirHorner of Infamy",
699+
"icons": [{
700+
"src": "launcher-icon-1x.png",
701+
"type": "image/png",
702+
"sizes": "48x48"
703+
},
704+
...
705+
{
706+
"src": "launcher-icon-4x.png",
707+
"type": "image/png",
708+
"sizes": "192x192"
709+
}],
710+
"start_url": "index.html?launcher=true"
711+
}
712+
</code></pre>
713+
<pre><code class="html">
714+
<link rel="manifest" href="/manifest.json">
715+
</code></pre>
716+
<p>
717+
<a href="https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/" class="credits" target="_blank">Code from Google Web Fundamentals</a>
718+
</p>
719+
</section>
720+
721+
<section>
722+
<h3>What can I tell the browser?</h3>
723+
<ul>
724+
<li>Home screen Icon</li>
725+
<li>Add a splash screen</li>
726+
<li>Set the launch style</li>
727+
<li>...and more</li>
728+
</ul>
729+
</section>
730+
731+
<section>
732+
<h3>Native vs browser launch style</h3>
733+
<img class="plain" style="max-height: 12em;" src="/src/img/manifest-display-options.png">
734+
<p>
735+
<a href="https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/" class="credits" target="_blank">Image from Google Web Fundamentals</a>
736+
</p>
737+
</section>
738+
739+
<section data-background-iframe="https://pwa.rocks/">
740+
<h1 style="font-size: 3.0em;" class="fallbackColor" >Anyone really does <a href="https://pwa.rocks/">that</a>?</h1>
741+
</section>
597742

743+
<section>
744+
<a href="https://wiki-offline.jakearchibald.com/wiki/Rick_and_Morty">
745+
<img class="plain" style="max-height: 15em;" src="/src/img/wikipedia.jpg">
746+
</a>
747+
<p>
748+
<a href="https://developers.google.com/web/updates/2015/11/app-shell" class="credits" target="_blank">Image from Google Web Updates</a>
749+
</p>
750+
</section>
598751

599752
</div>
600753
</div>

src/img/add-to-home-screen.gif

1.48 MB
Loading

src/img/appshell-1.jpg

155 KB
Loading

src/img/cc-good.png

34.8 KB
Loading
172 KB
Loading

src/img/wikipedia.jpg

230 KB
Loading

0 commit comments

Comments
 (0)