ui5-service-worker-sample
Description
This sample demonstrates how the Service Worker API, available in modern web browsers, could be used in a UI5 app to realize different caching strategies.
It includes the openui5-sample-app and combines it with the ui5-service-worker code itself.
DISCLAIMER: This sample demonstrates possible usages of service workers for caching strategies of an UI5 app. You have to figure out what parts to adopt for your own productive applications.
Requirements
- Node.js Version 10 or later
Download and Installation
-
Clone this repository and navigate into it
git clone https://github.com/SAP-samples/ui5-service-worker-sample.git cd ui5-service-worker-sample
-
Install all dependencies
npm install
-
Start a local server and run the application
npm start
-
Navigate to http://localhost:8080/index-cdn.html
Video
Content Structure
This ui5-service-worker-sample project consists of:
- openui5-sample-app
- Version: 0.2.0
- Commit: dd49883a79202b9134d5a9222a10f712a1ab06d3
- via public repository https://github.com/SAP/openui5-sample-app
- ui5-service-worker
- Version: 1.0.0
- via local folder ui5-service-worker/
Integrate into Own App
Follow the detailed Integration section on how you could extract and integrate the ui5-service-worker into your own application.
Configuration
Find additional configuration options of the ui5-service-worker in the Configuration section.
UI5con Presentation
This sample project was derived to showcase features originally presented at UI5con:
Alternative Scenarios
- Build the sample application to serve this preload variant from a local server using h2
npm run start-h2
Known Issues
No major bugs known.
Contributing
In general the contributing guidelines of OpenUI5 also apply to this project. They can be found here: https://github.com/SAP/openui5/blob/master/CONTRIBUTING.md
Some parts might not be relevant for this project (e.g. the browser-specific requirements like jQuery, CSS and accessibility in the "Contribution Content Guidelines") and the contribution process is easier (pull requests will be merged directly on GitHub).
License
Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.