mirror of
https://github.com/immich-app/immich.git
synced 2025-12-16 01:10:57 +03: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:
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 });
|
||||
}
|
||||
Reference in New Issue
Block a user