WebEssentials.AspNetCore.ServiceWorker | Progressive Web App is a set of technologies | Web Framework library
kandi X-RAY | WebEssentials.AspNetCore.ServiceWorker Summary
kandi X-RAY | WebEssentials.AspNetCore.ServiceWorker Summary
A Progressive Web App (PWA) is a set of technologies that can be applied to any type of website and web application, and it consist of 3 components:. This components makes Web App Manifest a natural and integrated part of any ASP.NET Core web application and it comes with pre-built service workers so you don't have to write your own.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WebEssentials.AspNetCore.ServiceWorker
WebEssentials.AspNetCore.ServiceWorker Key Features
WebEssentials.AspNetCore.ServiceWorker Examples and Code Snippets
Community Discussions
Trending Discussions on WebEssentials.AspNetCore.ServiceWorker
QUESTION
Asp.Net Core 2.2. MVC App which I am trying to turn into a Progressive Web App (PWA) using Mads Kristensen's WebEssentials.AspNetCore.PWA Package https://github.com/madskristensen/WebEssentials.AspNetCore.ServiceWorker and I am having some issues ensuring certain pages work offline.
The main functionality of the app involves a series of questions being presented to the user with the responses saved to a database. This view is populated by a ViewModel which queries the database in order to display the correct information.
My question is, as the database content will rarely change, am I able to cache the query result so the entire app can work offline? And if so, what is the best practice to do so?
My default map route is controller/action/id so when trying to utilize routesToPreCache in appsettings.json I am unable to include the id for the newly created 'incident' so it doesn't work - am I missing a simple trick or is the solution much more complex?
My controller for the view is as follows:
...ANSWER
Answered 2019-Feb-05 at 16:00What you want to do can certainly be done. However, it will require a moderate amount of 'heavy lifting'
Mads PWA utility works great, but it does shield you somewhat from the service worker and manifest files.
You'll need to set the manifest to cache the 'questions' page. This will tell the PWA to go ahead and cache the page automatically on the user's device without the user ever having visited it. That way when they are offline, it will appear when they eventually browse to that page.
However, if the user is offline, submitting data by the user involves two things: storing the response values to local storage (not too difficult), and then syncing up the user's browser local storage by triggering an event when the device is online and then sending that data to the remote (your) database (rather involved, hence difficult).
Hope that helps.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WebEssentials.AspNetCore.ServiceWorker
You need to do a few things to turn your website into a PWA:.
Add two image icons to your project (192x192 and 512x512)
Add a manifest.json file in the root of the wwwroot folder
Register a service in Startup.cs
Make sure it works
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page