mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: preload and cancel images with a service worker (#16893)
* feat: Service Worker to preload/cancel images and other resources * Remove caddy configuration, localhost is secure if port-forwarded * fix e2e tests * Cache/return the app.html for all web entry points * Only handle preload/cancel * fix e2e * fix e2e * e2e-2 * that'll do it * format * fix test * lint * refactor common code to conditionals --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
c664d99a34
commit
2fd05e8447
7 changed files with 108 additions and 17 deletions
8
web/src/lib/utils/sw-messaging.ts
Normal file
8
web/src/lib/utils/sw-messaging.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
const broadcast = new BroadcastChannel('immich');
|
||||
|
||||
export function cancelImageUrl(url: string) {
|
||||
broadcast.postMessage({ type: 'cancel', url });
|
||||
}
|
||||
export function preloadImageUrl(url: string) {
|
||||
broadcast.postMessage({ type: 'preload', url });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue