arcturus / gulp-sww

Gulp plugin that creates all the support needed in serviceworkers to make your web app run offline
29 stars 3 forks source link

Take advantage of defer and async #2

Closed gmarty closed 8 years ago

gmarty commented 8 years ago

Because the injected script is completely independent of all other potential JS scripts, we can take advantage of the defer and async attributes of the <script> tag. So the injected tag would look like:

<script defer async src="install-sw.js"></script>
gmarty commented 8 years ago

Also as discussed offline, it may be more efficient to append the tag just after the <html> tag.

arcturus commented 8 years ago

Closed by #3