Skip to content

Performance issue (cache-control: no-cache) #498

Description

@Saiv46

Symptom:

Nimiq Keyguard takes some time to load and display password prompt on every occurrence.

Reason:

Each of following URLs is being downloaded 5(!) times each time Nimiq Hub is opened:

https://keyguard.nimiq.com/assets/nimiq/worker.js
https://keyguard.nimiq.com/assets/nimiq/worker-wasm.js
https://keyguard.nimiq.com/assets/nimiq/worker-wasm.wasm

The problem is with Cache-Control: no-cache, must-revalidate, despite backend supporting (and sending) ETag and Last-modified headers, browsers will not even try to make conditional request to revalidate cache (as described for Request.cache).

Possible solutions:

  1. Updating WasmHelper.js to use fetch() instead of XHR.
  2. Fix Service Worker own caching to actually make it offline-capable.
  3. Setting Cache-Control: max-age=60, must-revalidate should resolve this issue. CDN-Cache-Control could be used alongside.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions