The document discusses Service Workers and how they can be used to cache assets and manage network requests. It provides code snippets for registering a Service Worker, caching assets during install, detecting and responding to fetch events by checking the cache and falling back to the network if needed, and updating the Service Worker by deleting old caches.
Service Worker allows web applications to work offline by intercepting network requests, caching responses, and serving cached responses when there is no network connection. It runs in the background and can handle events like fetch requests and push notifications. Key concepts include registering a service worker script, caching assets on install and user demand, and responding to fetch events by checking the cache first before making network requests. Common patterns are caching static resources on install, caching dynamic resources on each request, and migrating caches on activate. Service workers enable new capabilities like push notifications and progressive web apps.
Service Workers is coming. Bring your own magic with the first programmable cache in your script, and more!
Presented at the GDG Korea DevFest 2014 on the 31st of May 2014: https://sites.google.com/site/gdgdevfestkorea2014/
Introduction to Service Workers, a new Web API that allows developers to build app-like Progressive Apps with features ranging from Offline first to real Push notifications and more.
Everybody knows Javascript is single-threaded and that it shares this same thread with other browser-related processes such as painting and compositing. There are several techniques to implement pseudo multithreading in JavaScript; however, during this talk we will focus our attention on how to use and debug the Service Worker API. Our end goal is to explore practical use cases in order to simplify the process to render complex user interfaces and transitions in a browser.
The document discusses Service Workers, which allow web applications to work offline by caching assets and responding to fetch events. Some key points covered include:
- Service Workers can be used to cache assets on install to enable offline usage. They also allow programmable caching and handling of fetch events.
- Other capabilities include background processing and push notifications. The standard is maintained by the W3C.
- Service Workers have a lifecycle of registration, installation, and activation. They are scoped to URLs and can handle fetch events for navigation and subresource requests.
A presentation about the Service Worker.
Talk about the difference between AppCache and ServiceWorker, also show as possible with him and the idea for the future.
Demo: https://github.com/brunoosilva/service-worker
2017/01/23【F2E&RGBA Meetup】所分享的內容
簡介:
PWA (Progressive Web App) 是 Google 在 2015 年所提出的概念,2016 年我們開始看到許多 PWA 應用像是 The Washington Post、Flipkart、Gmail、AliExpress、Wikipedia、Flipboard、Booking 等實務案例,本次分享將介紹 PWA 與 HTML5 Offline API 搭配 Service Worker,讓我們的網站在離線的時候還能夠進行瀏覽,打造出更好的用戶體驗。
活動網址:
http://f2e.kktix.cc/events/f2e6-56d17c-0f9e5b-3997b7-a9203f-d684fd-886f38
slide for my talk at DevFest Abuja 2015, where I explained the process involved in developing offline first app by leveraging on the power of service worker.
Service Worker allows web applications to work offline by intercepting network requests, caching responses, and serving cached responses when there is no network connection. It runs in the background and can handle events like fetch requests and push notifications. Key concepts include registering a service worker script, caching assets on install and user demand, and responding to fetch events by checking the cache first before making network requests. Common patterns are caching static resources on install, caching dynamic resources on each request, and migrating caches on activate. Service workers enable new capabilities like push notifications and progressive web apps.
Service Workers is coming. Bring your own magic with the first programmable cache in your script, and more!
Presented at the GDG Korea DevFest 2014 on the 31st of May 2014: https://sites.google.com/site/gdgdevfestkorea2014/
Introduction to Service Workers, a new Web API that allows developers to build app-like Progressive Apps with features ranging from Offline first to real Push notifications and more.
Everybody knows Javascript is single-threaded and that it shares this same thread with other browser-related processes such as painting and compositing. There are several techniques to implement pseudo multithreading in JavaScript; however, during this talk we will focus our attention on how to use and debug the Service Worker API. Our end goal is to explore practical use cases in order to simplify the process to render complex user interfaces and transitions in a browser.
The document discusses Service Workers, which allow web applications to work offline by caching assets and responding to fetch events. Some key points covered include:
- Service Workers can be used to cache assets on install to enable offline usage. They also allow programmable caching and handling of fetch events.
- Other capabilities include background processing and push notifications. The standard is maintained by the W3C.
- Service Workers have a lifecycle of registration, installation, and activation. They are scoped to URLs and can handle fetch events for navigation and subresource requests.
A presentation about the Service Worker.
Talk about the difference between AppCache and ServiceWorker, also show as possible with him and the idea for the future.
Demo: https://github.com/brunoosilva/service-worker
2017/01/23【F2E&RGBA Meetup】所分享的內容
簡介:
PWA (Progressive Web App) 是 Google 在 2015 年所提出的概念,2016 年我們開始看到許多 PWA 應用像是 The Washington Post、Flipkart、Gmail、AliExpress、Wikipedia、Flipboard、Booking 等實務案例,本次分享將介紹 PWA 與 HTML5 Offline API 搭配 Service Worker,讓我們的網站在離線的時候還能夠進行瀏覽,打造出更好的用戶體驗。
活動網址:
http://f2e.kktix.cc/events/f2e6-56d17c-0f9e5b-3997b7-a9203f-d684fd-886f38
slide for my talk at DevFest Abuja 2015, where I explained the process involved in developing offline first app by leveraging on the power of service worker.
Service workers allow you to control how network requests from web pages are handled. They run scripts in the background to intercept and handle fetch events, allowing web applications to work offline by responding with cached responses. Before service workers, AppCache was used but had limitations. The lifecycle of a service worker involves registration, installation, activation, and controlling pages. Common uses are caching assets, providing offline functionality, and handling network responses. Challenges include debugging failed installations and limitations on credentials and CORS requests. Service workers also enable push notifications and background sync functionality.
Real World Lessons in Progressive Web Application & Service Worker CachingChris Love
Over the past year we have seen a lot of excitement around Progressive Web Applications. Browser evangelist are selling developers and business owners on their advantages and promising future. But what is the real story? What are the details to proper execution? What do engineers need to know to make their web sites into Progressive Web Applications that not only meet the minimum criteria, but meet the sales hype?
Searching the Pokedex offline is fun, what is the real experience like caching a business application? Caching application assets and data can be complex, especially for larger applications. What to cache, how long to cache and how to cache are all valid questions. Often, in an effort to just ship something, we cache nothing. When we don't cache, we disappoint the customer and miss a key promise of progressive web applications.
JavaScript APIs - The Web is the PlatformRobert Nyman
The document discusses JavaScript APIs and developing web apps. It covers topics like manifest files, installing web apps, offline capabilities, fullscreen support, camera, telephony, SMS, battery, vibration, and more. The goal is to enable running HTML5-based web apps across platforms like Windows, Mac, Android, and more using a common Web Runtime.
Instant and offline apps with Service WorkerChang W. Doh
2 parts of talking at Google Developer Summit 2016 Seoul
- How to optimize loading performance your web app
- Introducing to Service Worker & Offline 101
The Peanut Butter Cup of Web-dev: Plack and single page web appsJohn Anderson
This document discusses single page web applications and the Angular.js framework. It provides an example of a simple Angular app with two-way data binding between HTML and JavaScript. It also describes how Plack and Perl can be used to prototype and serve such single page apps from the backend during development before integrating a full backend. The document encourages starting simply and learning new techniques gradually.
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsRyan Weaver
Bower, Grunt, and RequireJS are just a few tools that have been re-shaping the frontend development world, replacing cluttered script tags and server-side build solutions with a sophisticated, but sometimes complex approach to dependency management and module loading. In this talk, we'll put on our trendy frontend developer hat and find out how these tools work and how they differ from what we might be used to. Most important, we'll see how using tools like this might look in Symfony2 and how our application can be a friendly place for a frontend guy/gal.
This document discusses progressive web apps (PWAs) and service workers. It provides an overview of service workers and how they can be used to cache web content and provide offline functionality. It also describes some common tools used with service workers like sw-toolbox, sw-precache, and sw-precache-webpack-plugin. Finally, it provides an example of how to implement a service worker in a PWA todo list application using these tools and techniques.
Automated release management with team city & octopusdeploy - NDC 2013Kristoffer Deinoff
The document discusses automated release management and continuous delivery using TeamCity and Octopus Deploy. It provides steps to configure a build pipeline in TeamCity that packages a .NET project into a NuGet package. The NuGet package is then deployed to various environments in Octopus Deploy using steps like publishing a website, running smoke tests, and verifying changes in user acceptance testing. It also discusses writing PowerShell scripts to automate packaging, publishing, and deployment tasks. Connecting an issue tracker to provide release notes from pending issues is also covered.
This document discusses building a RESTful web application with Angular.js and Bear.Sunday. It describes using Bear.Sunday as a RESTful backend CMS and Angular.js for the frontend. Everything in the system is treated as a resource, including custom resources that can call other resources. The backend provides REST, dependency injection, and aspect oriented programming capabilities. The frontend uses Angular components like routes, directives, controllers and services with two-way data binding and templates. Testing, dependency injection, and integration between the frontend and backend are also covered.
Service worker: discover the next web game changerSandro Paganotti
This talk aims to introduce the upcoming ServiceWorker technology, its basic functionalities, its lifecycle and its most common use cases. Then it moves to analyse in detail a less obvious implementation of this technology: how to create a wiki engine using ServiceWorker and IndexedDB.
This document discusses Spring Boot and how to leverage its features to simplify development. Some key points:
- Spring Boot aims to make development easier by making opinionated choices for developers and handling configuration automatically.
- Autoconfiguration allows Spring Boot to automatically configure applications based on dependencies without requiring explicit configuration.
- Conventions like starter dependencies and property files allow Spring Boot to further simplify setup.
- Features like embedded servers and default configurations handle much of the boilerplate code typically associated with Spring projects.
- Techniques like profiles, conditions, and meta-annotations give developers control over configurations while leveraging Spring Boot's defaults.
This is the short talk I delivered at the Ruby Underground Meetup in Tel Aviv for the local Ruby user group about some of the changes and new features in R
React is a UI library that is changing the way web applications are written. While there are many benefits to using React, managing an application's complexity as it scales is one of the most powerful.
Invited to introduce Docker to the Dept. for Information and Communication Services (Informations- und Kommunikationsdienste - IuK) at the University of Rostock.
Building Offline Ready and Installable Web AppMuhammad Samu
This talks introduces Progressive Web Apps as a way of building web applications that works like native application, keeping users engaged even when on flaky or no network connection also giving them the ability to install the app on their home screen
"Service Worker: Let Your Web App Feel Like a Native "FDConf
Service workers allow web applications to work offline by intercepting network requests, caching responses, and serving cached resources when there is no network connection. They also handle background synchronization and push notifications. Key capabilities include making apps available offline, controlling the cache and network requests, and subscribing to push notifications. Service workers operate separately from the main thread of the page, intercepting and modifying fetch events to return cached responses when available.
This document discusses using an HTTP proxy to load specific web pages for testing purposes. It explains that many web pages contain resources from multiple domains that cannot be saved locally. An HTTP proxy can be used to intercept requests and redirect local URLs to a test server, while passing through external URLs to the actual web server. The document provides code examples for setting up an HTTP proxy using HTTP::Proxy and modifying the LWP user agent to handle local and remote URLs differently. Using this approach allows a test loop to load repeatable web page content from both local and external sources.
Puppet Camp London Fall 2015 - Service Discovery and PuppetMarc Cluet
This document discusses service discovery and how it can be implemented using Consul. It begins with an introduction to the presenter and overview of service discovery challenges. The main points are:
- Consul is a service discovery tool that allows services to register themselves and discover other services via API or DNS queries. It supports health checking and secure key-value storage.
- Consul uses agents running on each node that register services and perform health checks. Services can be discovered via the REST API or DNS queries. It provides a strongly consistent key-value store.
- Puppet can integrate with Consul for service discovery via Puppet modules, Hiera backend, or direct API access. This allows dynamically generating configurations from service information in
This document discusses Service Workers and Progressive Web Apps (PWAs). It begins by introducing Service Workers and their benefits for creating instant and offline experiences. It then defines PWAs and discusses their key technologies like Manifest, Service Workers, and Push Notifications. Several real-world examples of popular PWAs are provided. Common Service Worker patterns and use cases are explained, such as precaching, caching on user demand, cache migration, and using Service Workers with Push Notifications. The document encourages developers to help build fast and reliable web experiences using these new web platform technologies.
A gentle Introduction to the concept of Progressive Web Apps, explaining the key concept needed to build a website/app that works even when your user is on a flaky network.
HTML5 provides new semantic elements like <article> and <header> that allow for more meaningful structure than generic divs and spans. It also enables new multimedia capabilities with <video>, <audio>, and the <canvas> element for drawing. Behind the scenes, HTML5 introduces APIs for offline web applications, local storage, and client-side databases. The document discusses these new features and how to use polyfills to provide fallback support for older browsers that don't yet support the full HTML5 specification.
Service workers allow you to control how network requests from web pages are handled. They run scripts in the background to intercept and handle fetch events, allowing web applications to work offline by responding with cached responses. Before service workers, AppCache was used but had limitations. The lifecycle of a service worker involves registration, installation, activation, and controlling pages. Common uses are caching assets, providing offline functionality, and handling network responses. Challenges include debugging failed installations and limitations on credentials and CORS requests. Service workers also enable push notifications and background sync functionality.
Real World Lessons in Progressive Web Application & Service Worker CachingChris Love
Over the past year we have seen a lot of excitement around Progressive Web Applications. Browser evangelist are selling developers and business owners on their advantages and promising future. But what is the real story? What are the details to proper execution? What do engineers need to know to make their web sites into Progressive Web Applications that not only meet the minimum criteria, but meet the sales hype?
Searching the Pokedex offline is fun, what is the real experience like caching a business application? Caching application assets and data can be complex, especially for larger applications. What to cache, how long to cache and how to cache are all valid questions. Often, in an effort to just ship something, we cache nothing. When we don't cache, we disappoint the customer and miss a key promise of progressive web applications.
JavaScript APIs - The Web is the PlatformRobert Nyman
The document discusses JavaScript APIs and developing web apps. It covers topics like manifest files, installing web apps, offline capabilities, fullscreen support, camera, telephony, SMS, battery, vibration, and more. The goal is to enable running HTML5-based web apps across platforms like Windows, Mac, Android, and more using a common Web Runtime.
Instant and offline apps with Service WorkerChang W. Doh
2 parts of talking at Google Developer Summit 2016 Seoul
- How to optimize loading performance your web app
- Introducing to Service Worker & Offline 101
The Peanut Butter Cup of Web-dev: Plack and single page web appsJohn Anderson
This document discusses single page web applications and the Angular.js framework. It provides an example of a simple Angular app with two-way data binding between HTML and JavaScript. It also describes how Plack and Perl can be used to prototype and serve such single page apps from the backend during development before integrating a full backend. The document encourages starting simply and learning new techniques gradually.
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsRyan Weaver
Bower, Grunt, and RequireJS are just a few tools that have been re-shaping the frontend development world, replacing cluttered script tags and server-side build solutions with a sophisticated, but sometimes complex approach to dependency management and module loading. In this talk, we'll put on our trendy frontend developer hat and find out how these tools work and how they differ from what we might be used to. Most important, we'll see how using tools like this might look in Symfony2 and how our application can be a friendly place for a frontend guy/gal.
This document discusses progressive web apps (PWAs) and service workers. It provides an overview of service workers and how they can be used to cache web content and provide offline functionality. It also describes some common tools used with service workers like sw-toolbox, sw-precache, and sw-precache-webpack-plugin. Finally, it provides an example of how to implement a service worker in a PWA todo list application using these tools and techniques.
Automated release management with team city & octopusdeploy - NDC 2013Kristoffer Deinoff
The document discusses automated release management and continuous delivery using TeamCity and Octopus Deploy. It provides steps to configure a build pipeline in TeamCity that packages a .NET project into a NuGet package. The NuGet package is then deployed to various environments in Octopus Deploy using steps like publishing a website, running smoke tests, and verifying changes in user acceptance testing. It also discusses writing PowerShell scripts to automate packaging, publishing, and deployment tasks. Connecting an issue tracker to provide release notes from pending issues is also covered.
This document discusses building a RESTful web application with Angular.js and Bear.Sunday. It describes using Bear.Sunday as a RESTful backend CMS and Angular.js for the frontend. Everything in the system is treated as a resource, including custom resources that can call other resources. The backend provides REST, dependency injection, and aspect oriented programming capabilities. The frontend uses Angular components like routes, directives, controllers and services with two-way data binding and templates. Testing, dependency injection, and integration between the frontend and backend are also covered.
Service worker: discover the next web game changerSandro Paganotti
This talk aims to introduce the upcoming ServiceWorker technology, its basic functionalities, its lifecycle and its most common use cases. Then it moves to analyse in detail a less obvious implementation of this technology: how to create a wiki engine using ServiceWorker and IndexedDB.
This document discusses Spring Boot and how to leverage its features to simplify development. Some key points:
- Spring Boot aims to make development easier by making opinionated choices for developers and handling configuration automatically.
- Autoconfiguration allows Spring Boot to automatically configure applications based on dependencies without requiring explicit configuration.
- Conventions like starter dependencies and property files allow Spring Boot to further simplify setup.
- Features like embedded servers and default configurations handle much of the boilerplate code typically associated with Spring projects.
- Techniques like profiles, conditions, and meta-annotations give developers control over configurations while leveraging Spring Boot's defaults.
This is the short talk I delivered at the Ruby Underground Meetup in Tel Aviv for the local Ruby user group about some of the changes and new features in R
React is a UI library that is changing the way web applications are written. While there are many benefits to using React, managing an application's complexity as it scales is one of the most powerful.
Invited to introduce Docker to the Dept. for Information and Communication Services (Informations- und Kommunikationsdienste - IuK) at the University of Rostock.
Building Offline Ready and Installable Web AppMuhammad Samu
This talks introduces Progressive Web Apps as a way of building web applications that works like native application, keeping users engaged even when on flaky or no network connection also giving them the ability to install the app on their home screen
"Service Worker: Let Your Web App Feel Like a Native "FDConf
Service workers allow web applications to work offline by intercepting network requests, caching responses, and serving cached resources when there is no network connection. They also handle background synchronization and push notifications. Key capabilities include making apps available offline, controlling the cache and network requests, and subscribing to push notifications. Service workers operate separately from the main thread of the page, intercepting and modifying fetch events to return cached responses when available.
This document discusses using an HTTP proxy to load specific web pages for testing purposes. It explains that many web pages contain resources from multiple domains that cannot be saved locally. An HTTP proxy can be used to intercept requests and redirect local URLs to a test server, while passing through external URLs to the actual web server. The document provides code examples for setting up an HTTP proxy using HTTP::Proxy and modifying the LWP user agent to handle local and remote URLs differently. Using this approach allows a test loop to load repeatable web page content from both local and external sources.
Puppet Camp London Fall 2015 - Service Discovery and PuppetMarc Cluet
This document discusses service discovery and how it can be implemented using Consul. It begins with an introduction to the presenter and overview of service discovery challenges. The main points are:
- Consul is a service discovery tool that allows services to register themselves and discover other services via API or DNS queries. It supports health checking and secure key-value storage.
- Consul uses agents running on each node that register services and perform health checks. Services can be discovered via the REST API or DNS queries. It provides a strongly consistent key-value store.
- Puppet can integrate with Consul for service discovery via Puppet modules, Hiera backend, or direct API access. This allows dynamically generating configurations from service information in
This document discusses Service Workers and Progressive Web Apps (PWAs). It begins by introducing Service Workers and their benefits for creating instant and offline experiences. It then defines PWAs and discusses their key technologies like Manifest, Service Workers, and Push Notifications. Several real-world examples of popular PWAs are provided. Common Service Worker patterns and use cases are explained, such as precaching, caching on user demand, cache migration, and using Service Workers with Push Notifications. The document encourages developers to help build fast and reliable web experiences using these new web platform technologies.
A gentle Introduction to the concept of Progressive Web Apps, explaining the key concept needed to build a website/app that works even when your user is on a flaky network.
HTML5 provides new semantic elements like <article> and <header> that allow for more meaningful structure than generic divs and spans. It also enables new multimedia capabilities with <video>, <audio>, and the <canvas> element for drawing. Behind the scenes, HTML5 introduces APIs for offline web applications, local storage, and client-side databases. The document discusses these new features and how to use polyfills to provide fallback support for older browsers that don't yet support the full HTML5 specification.
This document provides an overview of HTML5 features including new HTML5 elements, offline capabilities through the App Cache, local storage options, multimedia additions like video and audio, cross-domain messaging, and the Canvas API. It discusses using these features across browsers through polyfills and shims, and emphasizes the importance of JavaScript knowledge for full HTML5 implementation. Web Sockets are introduced as enabling real-time two-way communication through a persistent connection.
Service workers and the role they play in modern day web appsMukul Jain
Service workers have greatly improved the experience of web apps by providing offline access to pages, caching data, background sync and other native app-like features. Nowadays, Progressive Web Apps are working together with service workers to provide the users better performance and experience than a typical web app. But service worker’s power doesn’t just stop at giving offline experience and background notifications. They can be used in areas ranging from request deferring to the virtual server.
ServiceWorker: New game changer is coming!Chang W. Doh
I believe ServiceWorker is one of most important specifications for the next web world. Offline and its technologies are very friendly concepts to native application developers. But, now I think front-end developers have to know that for stepping into new paradigm. With ServiceWorker, you can make your web application can run offline, and it also means you can make your web application load extremely fast.
I've told about ServiceWorker very briefly in this slide. But you can understand how ServiceWorker runs on. If you want to know its usage, I highly recommend Topeka, which is a polymer demo application at google I/O 2014, that also includes material design and ServiceWorker in inside of it.
If you want to know ServiceWorker some more or in detail, I'd like to recommend to read the following, written by Jungkee Song, one of authors of this spec.
http://www.slideshare.net/jungkees/service-workers
In this session, you'll learn what's in store for Progressive Web Apps on Window - where they fit in alongside other Windows apps; how to get started converting a web site or web app into a Progressive Web App; how to submit PWAs to the Windows Store , and more.
Zero-config JavaScript apps with RaveJS -- SVCC fall 2014John Hann
Rave eliminates configuration, machinery, and complexity. Stop configuring and tweaking file watchers, minifiers, and transpilers just to get to a runnable app. Instead, go from zero to "hello world" in 30 seconds. In the next 30 seconds, easily add capabilities and frameworks to your application simply by installing *Rave Extensions* and *Rave Starter* packages from npm and Bower, the leading JavaScript package managers. Finally, install additional *Rave Extension* packages to apply your favorite build, deploy, and testing patterns.
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...Robert Nyman
The document discusses building apps for Firefox OS using open web technologies like HTML5, CSS, and JavaScript. It explains that apps can be developed like regular web apps and then packaged for installation on Firefox OS devices. Developers can access device APIs for features like contacts, notifications, and sensors. The document outlines the steps to take which include developing the app, creating a manifest file, and publishing/installing the app. It provides details on various web APIs and permissions available to Firefox OS apps.
One of the main advantages of web applications is their ease of deployment. The same can't be said about desktop applications. However, desktop applications work without a network connection. While this used to be a deal breaker for web applications, recent developments in HTML 5 and browser plugins such as Flash and Silverlight allow developers to create web applications that work both online and offline. In this session, Matt will demonstrate how to create offline web applications in HTML 5, Silverlight and Air. Also, other factors for offline applications, such as client-side data storage, will be examined in detail.
Laravel uses a bootstrapping process when an HTTP request is received:
1. Providers are registered with the application service container to make services available.
2. Filters and routes are registered to handle requests.
3. The request is handled by the router and processed by the matched route, with filters applied. The route then dispatches the request to the appropriate controller.
Spine.js is a client-side MVC framework that is primarily JavaScript but can also be used with Node. It uses prototypal inheritance and controllers based on the Backbone.js API. Models support events for CRUD operations and can be persisted using HTML5 local storage. The framework includes routing based on URL hashes and supports templating views and keeping models and views in sync.
BlackBerry DevCon 2011 - PhoneGap and WebWorksmwbrooks
PhoneGap and BlackBerry WebWorks allow developers to create cross-platform mobile apps using web technologies like HTML, CSS, and JavaScript. The document discusses how these tools were used to build a nursing app, including overcoming challenges related to platform differences and limitations. Feature detection was used to handle quirks across platforms. Performance was improved by dispatching functions asynchronously on BlackBerry 5. The developer recommends alternative approaches like using Backbone.js, jQuery Mobile, Jasmine BDD, and pre-generated JSON files for future projects.
This document discusses building websites using Node.ACS, which allows developing and publishing Node.js apps to the cloud. It provides an overview of Node.ACS and steps for installing, creating, and publishing a simple website using Node.ACS, including using an MVC framework and sessions. Examples of configuration files, controllers, and views are also included.
A quick guide for setting up Appcelerator's Node.ACS and examples on how to build three different types of websites/APIs. Code can be found at:
https://github.com/ricardoalcocer/acs_key_value_store
https://github.com/ricardoalcocer/nodeacs_sample_website
This document discusses best practices for developing Node.js applications. It recommends using frameworks like Express for building web apps, libraries like Async to avoid callback hell, and organizing code into modular sub-applications. It also covers testing, error handling, documentation, and open-sourcing projects. Standards like Felix's Style Guide and domain-driven design principles are advocated. Communication channels like events, HTTP APIs, and WebSockets are examined.
Maxim Salnikov - Service Worker: taking the best from the past experience for...Codemotion
There is no doubt that 2018 is the year when Progressive Web Apps will get the really broad adoption and recognition by all the involved parties: browser vendors (finally, all the major ones), developers, users. And the speed and smoothness of this process heavily depend on how correctly we, developers, use the power of new APIs. In my session based on the accumulated experience of developing and maintaining PWAs we go through the list of advanced tips & tricks, showcase best practices, learn how to avoid common pitfalls and have a look at the latest browser support and known limitations.
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
Learn how to use Ext JS and Cmd to deliver Progressive Web Applications to deliver the best of both web and mobile app experiences. Web apps can be found easily on the internet and every user is guaranteed access to the same and latest version of the application. Plus, mobile app capabilities, such as offline support and optimizing access to the underlying network using service workers, take the user experience to a whole new level.
An introduction to Express, the Sinatra-inspired MVC framework for Node.JS. You'll learn how Express manages and processes routes, how to use the Jade template engine, and how to design data models aimed to play nice with Express.
This document summarizes a workshop on optimizing bandwidth on mobile networks with increasing encryption. It lists the technical program committee and goals of exploring solutions while maintaining privacy and security. Sessions covered setting the scene on challenges with encryption, potential network/transport solutions, optimizing applications, and addressing regulation. Ideas generated included evolving TCP, providing network feedback to endpoints, blind caching, collaboration frameworks, and metrics. Next steps include publishing minutes and reports, and developing ideas on mailing lists.
Web Authentication: a Future Without Passwords?Natasha Rooney
The document discusses web authentication and the future of passwords. It provides an overview of public key cryptography concepts like asymmetric encryption. It then summarizes the FIDO Alliance standards of UAF and U2F which aim to provide passwordless authentication using public key cryptography during a registration process where keys are created and stored locally and on the server. It describes how the W3C Web Authentication working group is developing browser APIs and specifications to enable FIDO-based authentication directly in web applications by creating and validating credentials and assertions. The document provides code examples of how the WebAuthN API could be used for registration and authentication without requiring storage of sensitive user data locally or on the server.
The document discusses the work of the W3C Web Application Security Working Group (WebAppSec WG). It provides updates on several WebAppSec WG specifications and proposals, including Clear Site Data, Confinement with Origin Web Labels (COWL), Credential Management, and others. It notes the goals of each specification, provides examples of their use, and outlines current work and upcoming discussions at the W3C TPAC meeting. The document is a high-level summary of the WebAppSec WG's ongoing efforts to improve web application security.
STV (Single Transferable Vote) is a voting system that aims for proportional representation. Voters rank candidates in order of preference. The process involves multiple rounds of counting votes. In each round, candidates who reach a quota threshold are elected, and surplus votes from elected candidates are transferred to voters' next preferred candidates. Candidates with the fewest votes are eliminated and their votes are transferred in subsequent rounds until all seats are filled. There are arguments both for and against STV, including that it gives minority candidates a better chance while complexities may reduce voter understanding, and second choice candidates are at a disadvantage.
TCP and Mobile Networks Turbulent RelationshipNatasha Rooney
This document discusses TCP and its turbulent relationship with mobile networks. It provides an overview of TCP including that it is connection-oriented, reliable, uses cumulative ACKs, delivers packets in-order, is full-duplex, and uses a sliding window. The document then discusses issues TCP has over mobile networks, including that the congestion window remains small due to disconnections and high bit error rates. It proposes collecting data from mobile operators anonymously to send to the IETF to develop new, more mobile-friendly protocols.
Solving HTTP Problems With Code and ProtocolsNatasha Rooney
The document discusses HTTP and protocols related to transporting data over the internet. It describes the layered model including the physical, network, transport, and application layers. It then focuses on protocols like HTTP/1, SPDY, HTTP/2 and QUIC that operate at the application layer, with the goal of improving performance by reducing latency through techniques like header compression, multiplexing, and avoiding head-of-line blocking. It also discusses how QUIC aims to solve issues with TCP by operating over UDP while providing encryption, reliability and other features normally provided by TCP.
This document discusses various topics related to transport layer security (TLS) including:
- A brief history of TLS and its predecessors SSL.
- An overview of the TLS handshake process and how it establishes encryption between a client and server.
- Explanations of key TLS concepts like public-key cryptography, certificates, and different types of encryption.
- Performance considerations for TLS including reducing latency in the handshake process and optimizing TLS configuration.
- Methods for improving TLS performance such as using session tickets, TLS false start, HTTP/2, and content delivery networks.
This document summarizes Natasha Rooney's presentation on QUIC and the evolution of HTTP. Some key points include:
- QUIC aims to improve performance over TCP by eliminating head-of-line blocking and reducing latency through 0-RTT connections.
- It achieves this by multiplexing streams over a UDP connection and integrating TLS 1.3 for encryption to provide security.
- Early results show QUIC reducing page load times by 15-18% for video and 3.6-8% for search queries on Google's services.
- As QUIC becomes more widely adopted, it may continue to improve performance for a "long tail" of users on slower or more unreliable networks.
JQuery UK February 2015: Service Workers On VacayNatasha Rooney
Webapps are awesome, and travel is awesome, but the two together suck. Roaming, aeroplanes, bad connections and flakey wifi make native apps so much more attractive when travelling. The offline-capable gap between web native needs to be quashed, and Service Worker is coming to do the quashing! This talk will go through the simple use case of creating an offline-capable webapp using caching in ServiceWorker, complete with pulling in data and retaining data for offline view.
The document discusses the GSMA's involvement with the W3C through the Web and Mobile Interest Group. It provides an overview of the GSMA as a telecom association representing mobile operators worldwide. It then discusses the Web and Mobile Interest Group's goals of accelerating the development of web technologies for mobile applications. Specifically, it aims to highlight needs across industries, support W3C work, and create an open ecosystem for innovation. The group was preceded by the Coremob and Webmob communities and focuses on topics like offline capabilities, payments, and security to develop the core mobile web platform.
Making it Work Offline: Current & Future Offline APIs for Web AppsNatasha Rooney
We go through the current APIs for creating offline capable web apps such as LocalStorage, App Cache and a bit of IndexedDB. We also take a look at the work going behind the new solution "ServiceWorker" and how it may change the game.
Demo to support the presentation is here: https://github.com/nrooney/offlineanime
FirefoxOS Meetup - Updates on Offline in HTML5 Web AppsNatasha Rooney
This document summarizes Natasha Rooney's presentation on offline web apps. The presentation discussed issues with the App Cache API and introduced Service Workers as a new solution. It highlighted that App Cache was not well-suited for separating caching of shell content from dynamic content. Service Workers address this by allowing developers more control over caching and fallbacks. The presentation concluded that Service Workers enable better support for offline apps through features like multiple caches, fallbacks, and promises.
Updates on Offline: “My AppCache won’t come back” and “ServiceWorker Tricks ...Natasha Rooney
My slides from my talk "Updates on Offline: “My AppCache won’t come back” and “ServiceWorker Tricks for Cache”" from Over the Air 2013 held in September in Bletchley Park. We had a good run-through of offline APIs in web, the mysteries of App Cache, and updates on the current status of ServiceWorker.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
20 Comprehensive Checklist of Designing and Developing a WebsitePixlogix Infotech
Dive into the world of Website Designing and Developing with Pixlogix! Looking to create a stunning online presence? Look no further! Our comprehensive checklist covers everything you need to know to craft a website that stands out. From user-friendly design to seamless functionality, we've got you covered. Don't miss out on this invaluable resource! Check out our checklist now at Pixlogix and start your journey towards a captivating online presence today.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
15. @thisNatasha
Ok fine, but what is it?
Worker: script
separate from the
webpageDifferent
Lifecycle
Terminated when
not in use
16. @thisNatasha
Ok fine, but what is it?
Worker: script
separate from the
webpageDifferent
Lifecycle
“In terms of network control, it acts like a
proxy server sitting on the client, you get to
decide what to do on a request-by-request
basis. You can use this to make stuff work
faster, offline, or build new features.”
Jake Archibald
Terminated when
not in use
18. @thisNatasha
Two APIs one interface representing a proxy for a value
not necessarily known when that thing is created… (um, Promises)
Fetch
Gives
ServiceWorkers
the powers to
manage network
requests and
return responses
for resources
https://fetch.spec.whatwg.org/
https://slightlyoff.github.io/ServiceWorke
r/spec/service_worker/index.html#cach
e-objects
Cache
Save fetched
responses, return
these responses
later, not part of
HTTP cache
+ Promises
27. @thisNatasha
Register
Register your ServiceWorker in your main JavaScript file.
// filename: app.js
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful,
scope: ', registration.scope);
}).catch(function(err) {
// registration failed
console.log('ServiceWorker registration failed: ', err);
});
}
source: html5rocks
28. @thisNatasha
Register
Register your ServiceWorker in your main JavaScript file.
// filename: app.js
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful,
scope: ', registration.scope);
}).catch(function(err) {
// registration failed
console.log('ServiceWorker registration failed: ', err);
});
}
source: html5rocks
app.js
29. @thisNatasha
Register
Register your ServiceWorker in your main JavaScript file.
// filename: app.js
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful,
scope: ', registration.scope);
}).catch(function(err) {
// registration failed
console.log('ServiceWorker registration failed: ', err);
});
}
source: html5rocks
SW location
30. @thisNatasha
Register
Register your ServiceWorker in your main JavaScript file.
// filename: app.js
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful,
scope: ', registration.scope);
}).catch(function(err) {
// registration failed
console.log('ServiceWorker registration failed: ', err);
});
}
source: html5rocks
Browser does
the rest!
31. @thisNatasha
Create sw.js
Or whatever you want to call your ServiceWorker javascript file...
// filename: sw.js
TIP: sw.js goes
in the root of
the domain
32. @thisNatasha
Install
Give assets you want to run offline
// filename: sw.js
// The files we want to cache
var shellcache = 'shell-v1';
var urlsToCache = [
'/',
'/app/css/dist/bootstrap.min.css',
'/app/js/dist/angular.min.js',
'/app/js/dist/jquery-1.11.2.min.js',
'/app/js/dist/bootstrap.min.js'
];
// INSTALL
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(shellcache) //our cache!
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache); //pass all our urls!
})
);
});
33. @thisNatasha
// filename: sw.js
// The files we want to cache
var shellcache = 'shell-v1';
var urlsToCache = [
'/',
'/app/css/dist/bootstrap.min.css',
'/app/js/dist/angular.min.js',
'/app/js/dist/jquery-1.11.2.min.js',
'/app/js/dist/bootstrap.min.js'
];
// INSTALL
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(shellcache) //our cache!
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache); //pass all our urls!
})
);
});
Install
Give assets you want to run offline
Setup and
populate
caches!
34. @thisNatasha
// filename: sw.js
// The files we want to cache
var shellcache = 'shell-v1';
var urlsToCache = [
'/',
'/app/css/dist/bootstrap.min.css',
'/app/js/dist/angular.min.js',
'/app/js/dist/jquery-1.11.2.min.js',
'/app/js/dist/bootstrap.min.js'
];
// INSTALL
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(shellcache) //our cache!
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache); //pass all our urls!
})
);
});
Install
opened
cache!
Give assets you want to run offline
35. @thisNatasha
// filename: sw.js
// The files we want to cache
var shellcache = 'shell-v1';
var urlsToCache = [
'/',
'/app/css/dist/bootstrap.min.css',
'/app/js/dist/angular.min.js',
'/app/js/dist/jquery-1.11.2.min.js',
'/app/js/dist/bootstrap.min.js'
];
// INSTALL
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(shellcache) //our cache!
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache); //pass all our urls!
})
);
});
Install
pass in array
of files
Give assets you want to run offline
36. @thisNatasha
// filename: sw.js
// The files we want to cache
var shellcache = 'shell-v1';
var urlsToCache = [
'/',
'/app/css/dist/bootstrap.min.css',
'/app/js/dist/angular.min.js',
'/app/js/dist/jquery-1.11.2.min.js',
'/app/js/dist/bootstrap.min.js'
];
// INSTALL
self.addEventListener('install', function(event) {
// Perform install steps
event.waitUntil(
caches.open(shellcache) //our cache!
.then(function(cache) {
console.log('Opened cache');
return cache.addAll(urlsToCache); //pass all our urls!
})
);
});
Install
TIP: everything
must cache at
install to be
successful!
Give assets you want to run offline
44. @thisNatasha
// sw.js
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
if (response) {
return response; // cache hit! return response
}
// IMPORTANT: Clone the request.
var fetchRequest = event.request.clone();
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
Caching
Detected fetches, return match if so or get from network as fallback
pass promise
caches.match
45. @thisNatasha
// sw.js
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
if (response) {
return response; // cache hit! return response
}
// IMPORTANT: Clone the request.
var fetchRequest = event.request.clone();
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
Caching
hmmm, any
matches in my
caches?
Detected fetches, return match if so or get from network as fallback
46. @thisNatasha
Caching
// sw.js
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
if (response) {
return response; // cache hit! return response
}
// IMPORTANT: Clone the request.
var fetchRequest = event.request.clone();
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
Got it! Awesome,
so return it!
Detected fetches, return match if so or get from network as fallback
47. @thisNatasha
Caching
// sw.js
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(function(response) {
if (response) {
return response; // cache hit! return response
}
// IMPORTANT: Clone the request.
var fetchRequest = event.request.clone();
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
Aw nothing in
cache, get from
network
Detected fetches, return match if so or get from network as fallback
48. @thisNatasha
Caching
Got it from the network? Why not add to the cache?
// sw.js
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response. A response is a stream
// and because we want the browser to consume the response
// as well as the cache consuming the response, we need
// to clone it so we have 2 stream.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
});
return response;
}
);
})
);
});
49. @thisNatasha
Caching
Got it from the network? Why not add to the cache?
// sw.js
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200
|| response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response. A response is a stream
// and because we want the browser to consume the response
// as well as the cache consuming the response, we need
// to clone it so we have 2 stream.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
});
return response;
}
);
})
);
check response
50. @thisNatasha
Caching
Got it from the network? Why not add to the cache?
// sw.js
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200
|| response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response. A response is a stream
// and because we want the browser to consume the response
// as well as the cache consuming the response, we need
// to clone it so we have 2 stream.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
});
return response;
}
);
})
);
clone response
51. @thisNatasha
Caching
Got it from the network? Why not add to the cache?
// sw.js
return fetch(fetchRequest).then(
function(response) {
// Check if we received a valid response
if(!response || response.status !== 200
|| response.type !== 'basic') {
return response;
}
// IMPORTANT: Clone the response. A response is a stream
// and because we want the browser to consume the response
// as well as the cache consuming the response, we need
// to clone it so we have 2 stream.
var responseToCache = response.clone();
caches.open(CACHE_NAME)
.then(function(cache) {
cache.put(event.request, responseToCache);
});
return response;
}
);
})
);
add to cache
69. @thisNatasha
New Questions
Super new! What else do we need to know!?
How does this scale?
Does SW improve
performance?
How complex does
development become?