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:
- Updating
WasmHelper.js to use fetch() instead of XHR.
- Fix Service Worker own caching to actually make it offline-capable.
- Setting
Cache-Control: max-age=60, must-revalidate should resolve this issue. CDN-Cache-Control could be used alongside.
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:
The problem is with
Cache-Control: no-cache, must-revalidate, despite backend supporting (and sending)ETagandLast-modifiedheaders, browsers will not even try to make conditional request to revalidate cache (as described for Request.cache).Possible solutions:
WasmHelper.jsto usefetch()instead of XHR.Cache-Control: max-age=60, must-revalidateshould resolve this issue.CDN-Cache-Controlcould be used alongside.