<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[8988] sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins: Service Worker Caching: Add notes for iteration.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/8988">8988</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/8988","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>iandunn</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-06-24 19:22:05 +0000 (Mon, 24 Jun 2019)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Service Worker Caching: Add notes for iteration.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsserviceworkercachingphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/service-worker-caching.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsthemetemplatespartslocationphp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/parts/location.php</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsthemetemplatestemplatesdayofeventsrccomponentslatestpostsjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/day-of-event/src/components/latest-posts.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsthemetemplatestemplatesofflinephp">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/offline.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsserviceworkercachingphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/service-worker-caching.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/service-worker-caching.php     2019-06-22 10:33:28 UTC (rev 8987)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/service-worker-caching.php       2019-06-24 19:22:05 UTC (rev 8988)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,12 +12,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wp_front_service_worker',    __NAMESPACE__ . '\set_navigation_caching_strategy' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// todo is prompt to save offline automatically showing on mobile?
-       // if so, not sure we want it to
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// todo prompt to install app to home screen is automatically showing on mobile
+       // not sure we want it to
</ins><span class="cx" style="display: block; padding: 0 10px">         // not really related to this file, but nothing closer at the moment
</span><span class="cx" style="display: block; padding: 0 10px">        // maybe want it to be eventually, but not until we do more work to really make the site use pwa features well?
</span><span class="cx" style="display: block; padding: 0 10px">        // otherwise risk giving users bad impression of pwas
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// also, says "install wordcamp" instead of "install wordcamp europe" - maybe manifest issue?
+
+// after adding to home screen, there's a delay and a "wordcamp" interstitial screen before the site appears.
+       // why? can remove that? it should load instantly, right? that's the whole idea
+
+// experience on mid-level phone (moto e4) and fast bandwidth is pretty poor
+       // what's the cause? big images? too much markup to parse? server slow ttfb?
+       // maybe just needs to have better perceived speed rather than better actual speed? like transitions between screens
+               // maybe new default theme that's a SPA and has a subtle transition animation when fetching new page content from API
+
+// what's the point of adding to home screen? doesn't seem like it has anything extra cached for offline use
+       // maybe if can detect when it's installed, we should pre-cache more things, for faster loading and more offline accessibility?
+
+// maybe avoid loading images on slow connections
+       // related https://github.com/xwp/pwa-wp/issues/110, probably better to contribute to that (or new issue in that repo), than build custom. would be good feature for core
+       // https://github.com/wceu/wordcamp-pwa-page/issues/5
+       // https://deanhume.com/dynamic-resources-using-the-network-information-api-and-service-workers/
+       // this isn't really caching, so maybe create a separate file for it, or refactor this to be everything related to service workers.
+               // probably the former, `service-worker-misc.php`
+
+// having multiple tabs open, when 1 has a youtube embed playing, then refresh other tab, the video in first tab stops playing
+       // doesn't happen every time though
+
+
+
+
+
+
+// open issue w/ pwa lpugin - this may be plugin territory, but save offline button to add to precache route?
+       // similar to that one site
+//     or does it do that automatically already?
+//
+//maybe button to download all pages (not all posts or other cotent types, just pages, so that whole site heirarchy is accessible offline)
+
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * Register caching routes with both service workers.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,6 +60,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /*
</span><span class="cx" style="display: block; padding: 0 10px">         * todo
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * pre-cache important pages like Location. what others? how to detect programatically?
+        *      could match `location` slug, and also add a `service-worker-precache` postmeta field to post stubs that we create on new sites
+        *      maybe pwa feature plugin already supports something like that? if not, maybe propose it
+        *      offline and day-of-event templates could show warnings to logged-in admins if the key is missing b/c they didn't use the default page
</ins><span class="cx" style="display: block; padding: 0 10px">          * Is the wp-content/includes caching route even working? Didn't cache assets for offline template.
</span><span class="cx" style="display: block; padding: 0 10px">         *      How can you tell if it's working, compared to regular browser caching?
</span><span class="cx" style="display: block; padding: 0 10px">         *      devtools Network panel should say "From service worker" for size?
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsthemetemplatespartslocationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/parts/location.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/parts/location.php     2019-06-22 10:33:28 UTC (rev 8987)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/parts/location.php       2019-06-24 19:22:05 UTC (rev 8988)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,6 +8,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // how to get without hardcoding?
</span><span class="cx" style="display: block; padding: 0 10px">        // can pull address from `wordcamp` post type, maybe create a link to Google Maps driving directions with the starting place blank so they type that
</span><span class="cx" style="display: block; padding: 0 10px">        // it'd be nice to pull in content from the Location page, but don't have a way to programatically detect that, and could have lots of non-essential content mixed in with it
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // could identify location page by post meta inserted into stub when site created
+               // if can't find page w/ that, then fall back to address from wordcamp post
+       // maybe the full location page would have too much content for this context though? it'd still be good to automatically cache that for offline use, though, and the above approach could work well for that
+               // for low-bandwidth users, probably only want to install if add to home screen
+                       // maybe that kind of functionality should be built into pwa feature plugin instead of custom
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// include from day-of-event template and offline template
-       // link to gmaps wouldn't make sense in offline scenario, though. maybe detect which template it's being included from and show link or not based on that
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// include this from day-of-event template and from offline template
+       // link to gmaps wouldn't make sense in offline scenario, though. maybe detect which template it's being included from and show link or not based on that
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsthemetemplatestemplatesdayofeventsrccomponentslatestpostsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/day-of-event/src/components/latest-posts.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/day-of-event/src/components/latest-posts.js  2019-06-22 10:33:28 UTC (rev 8987)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/day-of-event/src/components/latest-posts.js    2019-06-24 19:22:05 UTC (rev 8988)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,6 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        <a href={ archiveUrl } className="all-posts">
</span><span class="cx" style="display: block; padding: 0 10px">                                { _x( 'View all Posts', 'title', 'wordcamporg' ) }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                {/* todo figure out good solution for this: https://github.com/wceu/wordcamp-pwa-page/issues/6#issuecomment-504268038 */}
</ins><span class="cx" style="display: block; padding: 0 10px">                         </a>
</span><span class="cx" style="display: block; padding: 0 10px">                </div>
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsthemetemplatestemplatesofflinephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/offline.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/offline.php  2019-06-22 10:33:28 UTC (rev 8987)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/theme-templates/templates/offline.php    2019-06-24 19:22:05 UTC (rev 8988)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,6 +72,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                /*
</span><span class="cx" style="display: block; padding: 0 10px">                 * todo
</span><span class="cx" style="display: block; padding: 0 10px">                 *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * this doesn't have headlines for separate days. why not? will probably be fixed by replacing block with shortcode though
</ins><span class="cx" style="display: block; padding: 0 10px">                  * maybe need to specify params to show all days/all tracks/etc
</span><span class="cx" style="display: block; padding: 0 10px">                 * disable "favorites" b/c it won't work? well, some parts will and some parts won't. probably better to leave it, but think about in more detail
</span><span class="cx" style="display: block; padding: 0 10px">                 * replace w/ Schedule block once that's available, but use feature flag for back-compat
</span></span></pre>
</div>
</div>

</body>
</html>