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.
- Node.js Version 14 or later
-
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
-
Build the application
npm run build-ui5
-
Start a local server and run the application
npm start
-
Navigate to http://localhost:8080/index.html
This ui5-service-worker-sample project consists of:
- openui5-sample-app
- Version: 0.3.0
- Commit: f71d13de9ba827d1429b568296a89b92cabb8315
- via public repository https://github.com/SAP/openui5-sample-app
- ui5-service-worker
- Version: 1.0.0
- via local folder ui5-service-worker/
Follow the detailed Integration section on how you could extract and integrate the ui5-service-worker into your own application.
Find additional configuration options of the ui5-service-worker in the Configuration section.
This sample project was derived to showcase features originally presented at UI5con:
- Serve the sample application with a local server using h2
npm run start-h2
No major bugs known.
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).
As artificial intelligence evolves, AI-generated code is becoming valuable for many software projects, including open-source initiatives. While we recognize the potential benefits of incorporating AI-generated content into our open-source projects there are certain requirements that need to be reflected and adhered to when making contributions.
Please see our guideline for AI-generated code contributions to SAP Open Source Software Projects for these requirements.
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.