To initialize a Service Worker one has to include in thead <head>
something like:
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/my-sw.js');
}
</script>
I found that in some example pages this isn't the first script (e.g. flipkart.com) of the page. Shouldn't it be the first one so that pre-caching and other features can be used ASAP? Does or doesn't the order actually matter for this script and it could well be at the bottom of the page outside </head>
?