Issue description
It should be possible to download and update all resources a user will need. Use a secondary manifest to achieve this. Here it will also become necessary to crawl the pages of a user and compute not only the primary documents but also all secondary assets necessary, e.g. the form will work differently as it will dowload the complete range.
Developer comments
Here is the procedure: fetch everything in one file. Assemble all resources into a JSON array of resources objects consisting of uri, headers and a baseencoded body. Do not zip, as HTTP takes care of that and it unnecessarily complicates the service worker. Throw content onto a new cache then activate. Then claim, then wipe all old cache(s).
The question is when to do that? On service worker activate? It should not happen too often. Ideally on a save.
The app download works with a POST request. While this might come as a surprise, this is the best way and works well. The app download bundels all assets (or items) relevant for the user and packs them into one big JSON object. The items are base 64 encoded and contain an etag. It also ships with a manifest which is persisted in the cache on the client. This manifest is sent on subsequent app downloads. While i consider this a big parameterized query, it is not possible for whatever reason to set a body on GET via fetch. The current manifest on the client might be too big for the query string, so it is a POST. Sending no current or "old" manifest, triggers a full download. Otherwise items that have the same etag are ommited. The list of "links" that are deemed essential for the user, aka "core app" or just "app", is dynamic and part of the service worker JavaScript file.
The cache is filled by browsing as well, so the manifest gets outdated, but that is a minor problem. Could be avoided with a better way of persisting the manifest, not as a document but item per item. This would require using IndexedDB in the service worker, but less sophistication is better in this early stage. Main thing is that there is a single request and everything comes in one go.
Cache only the core? This would take care of the stale assets problem.
|
Work sessions27
Start |
2021-10-24T06:35:50
|
End |
2021-10-24T08:22:24
|
Participant |
Robert Cerny
|
Start |
2021-10-25T06:00:46
|
End |
2021-10-25T10:42:12
|
Participant |
Robert Cerny
|
Start |
2021-10-25T14:59:31
|
End |
2021-10-25T15:41:38
|
Participant |
Robert Cerny
|
Start |
2021-10-25T20:57:09
|
End |
2021-10-25T21:57:09
|
Participant |
Robert Cerny
|
Start |
2021-10-26T06:31:46
|
End |
2021-10-26T13:54:57
|
Participant |
Robert Cerny
|
Start |
2021-10-26T14:41:39
|
End |
2021-10-26T16:07:06
|
Participant |
Robert Cerny
|
Start |
2021-10-26T19:34:38
|
End |
2021-10-26T21:19:54
|
Participant |
Robert Cerny
|
Start |
2021-10-27T06:17:53
|
End |
2021-10-27T06:58:22
|
Participant |
Robert Cerny
|
Start |
2021-10-27T08:00:00
|
End |
2021-10-27T10:00:51
|
Participant |
Robert Cerny
|
Start |
2021-10-27T10:45:13
|
End |
2021-10-27T11:19:18
|
Participant |
Robert Cerny
|
Start |
2021-10-27T11:42:38
|
End |
2021-10-27T13:53:33
|
Participant |
Robert Cerny
|
Start |
2021-10-28T07:28:16
|
End |
2021-10-28T09:38:53
|
Participant |
Robert Cerny
|
Start |
2021-10-28T10:03:15
|
End |
2021-10-28T12:16:05
|
Participant |
Robert Cerny
|
Start |
2021-10-28T12:35:11
|
End |
2021-10-28T14:22:04
|
Participant |
Robert Cerny
|
Start |
2021-10-30T06:05:24
|
End |
2021-10-30T08:42:04
|
Participant |
Robert Cerny
|
Start |
2021-10-30T09:21:27
|
End |
2021-10-30T10:15:19
|
Participant |
Robert Cerny
|
Start |
2021-10-30T11:21:51
|
End |
2021-10-30T12:46:23
|
Participant |
Robert Cerny
|
Start |
2021-10-30T13:46:59
|
End |
2021-10-30T14:45:54
|
Participant |
Robert Cerny
|
Start |
2021-10-31T07:50:10
|
End |
2021-10-31T08:50:17
|
Participant |
Robert Cerny
|
Start |
2021-11-04T06:39:08
|
End |
2021-11-04T08:34:17
|
Participant |
Robert Cerny
|
Start |
2021-11-04T09:54:27
|
End |
2021-11-04T12:57:29
|
Participant |
Robert Cerny
|
Start |
2021-11-04T14:12:40
|
End |
2021-11-04T16:12:44
|
Participant |
Robert Cerny
|
Start |
2021-11-05T05:41:21
|
End |
2021-11-05T06:56:06
|
Participant |
Robert Cerny
|
Start |
2021-11-05T07:28:12
|
End |
2021-11-05T08:29:12
|
Participant |
Robert Cerny
|
Start |
2021-11-05T08:41:05
|
End |
2021-11-05T10:31:21
|
Participant |
Robert Cerny
|
Start |
2021-11-08T05:17:36
|
End |
2021-11-08T08:34:43
|
Participant |
Robert Cerny
|
Start |
2021-11-08T08:49:47
|
End |
2021-11-08T12:05:56
|
Participant |
Robert Cerny
|
|