Difference between revisions of "Service Worker"

From MgmtWiki
Jump to: navigation, search
(Full Title or Meme)
Line 2: Line 2:
  
 
A [[Service Worker]], as defined by the [[World Wide Web Consortium]] (W3C) as a [https://en.wikipedia.org/wiki/Web_worker Web Worker] and the Web Hypertext Application Technology Working Group (WHATWG), is a [[JavaScript]] [[scripting language|script]] executed from an [[Web Site]] that runs in the [[background process|background]], independently of user-interface scripts that may also have been executed from the same HTML page.<ref name="WHATWG">  ''Web Workers'' Web Hypertext Application Technology Working Group (2010-06-03) http://www.whatwg.org/specs/web-workers/current-work/</ref> Web workers are often able to utilize multi-core CPUs more effectively.<ref> ''HTML Living Standard'' (2017-01-30) https://html.spec.whatwg.org/multipage/workers.html#delegation</ref>
 
A [[Service Worker]], as defined by the [[World Wide Web Consortium]] (W3C) as a [https://en.wikipedia.org/wiki/Web_worker Web Worker] and the Web Hypertext Application Technology Working Group (WHATWG), is a [[JavaScript]] [[scripting language|script]] executed from an [[Web Site]] that runs in the [[background process|background]], independently of user-interface scripts that may also have been executed from the same HTML page.<ref name="WHATWG">  ''Web Workers'' Web Hypertext Application Technology Working Group (2010-06-03) http://www.whatwg.org/specs/web-workers/current-work/</ref> Web workers are often able to utilize multi-core CPUs more effectively.<ref> ''HTML Living Standard'' (2017-01-30) https://html.spec.whatwg.org/multipage/workers.html#delegation</ref>
The W3C and WHATWG envision web workers as long-running scripts that are not interrupted by user-interface scripts (scripts that respond to clicks or other user interactions).  Keeping such workers from being interrupted by user activities should allow Web pages to remain responsive at the same time as they are running long tasks in the background.
+
 
  
 
==Context==
 
==Context==
Line 13: Line 13:
 
==Solution==
 
==Solution==
 
* Service worker script act as the extra layer between website requests and internet servers. It makes caching any content easier whenever visitor tries to access the [[Progressive Web App]] enabled page. The information is further saved locally on the device of user.
 
* Service worker script act as the extra layer between website requests and internet servers. It makes caching any content easier whenever visitor tries to access the [[Progressive Web App]] enabled page. The information is further saved locally on the device of user.
 +
*The W3C and WHATWG envision web workers as long-running scripts that are not interrupted by user-interface scripts (scripts that respond to clicks or other user interactions).  Keeping such workers from being interrupted by user activities should allow Web pages to remain responsive at the same time as they are running long tasks in the background.
 
* [https://googlechrome.github.io/samples/service-worker/basic/ Basic Service Worker Sample] from Google to pre-cache script and other files for [[Web App]].
 
* [https://googlechrome.github.io/samples/service-worker/basic/ Basic Service Worker Sample] from Google to pre-cache script and other files for [[Web App]].
  

Revision as of 08:05, 18 May 2019

Full Title or Meme

A Service Worker, as defined by the World Wide Web Consortium (W3C) as a Web Worker and the Web Hypertext Application Technology Working Group (WHATWG), is a JavaScript script executed from an Web Site that runs in the background, independently of user-interface scripts that may also have been executed from the same HTML page.[1] Web workers are often able to utilize multi-core CPUs more effectively.[2]


Context

  • The simplest use of workers is for performing a computationally expensive task without interrupting the user interface.
  • The W3C and the WHATWG are currently in the process of developing a definition for an application programming interface (API) for web workers.[1]

Problems

  • Native mobile apps deliver rich experiences and high performance, purchased at the expense of storage space, lack of real-time updates, and low search engine visibility.[3]
  • Traditional web apps suffer from the inverse set of factors: lack of a native compiled executable, along with dependence on unreliable and potentially slow web connectivity.

Solution

  • Service worker script act as the extra layer between website requests and internet servers. It makes caching any content easier whenever visitor tries to access the Progressive Web App enabled page. The information is further saved locally on the device of user.
  • The W3C and WHATWG envision web workers as long-running scripts that are not interrupted by user-interface scripts (scripts that respond to clicks or other user interactions). Keeping such workers from being interrupted by user activities should allow Web pages to remain responsive at the same time as they are running long tasks in the background.
  • Basic Service Worker Sample from Google to pre-cache script and other files for Web App.

References

  1. 1.0 1.1 Web Workers Web Hypertext Application Technology Working Group (2010-06-03) http://www.whatwg.org/specs/web-workers/current-work/
  2. HTML Living Standard (2017-01-30) https://html.spec.whatwg.org/multipage/workers.html#delegation
  3. Learn Everything About Progressive Web Apps. HTML Panda https://www.htmlpanda.com/blog/learn-everything-about-progressive-web-apps/

Other References