feat(waiter): keep the menu's photos for offline (platform-v2 step 5.2)

Right after the menu is read the phone downloads its photos (4 at a time,
services/photoCache.js). The library's year-long immutable headers keep them
in the browser cache; the installed PWA also caches /api/media/file/ cache-
first (workbox `xenia-media`). With no connection the menu still shows them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 15:57:51 +02:00
co-authored by Claude Opus 5.5
parent e09056a7a4
commit 15bd0f5b57
4 changed files with 45 additions and 1 deletions
+11 -1
View File
@@ -64,7 +64,17 @@ export default defineConfig(({ mode }) => {
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
runtimeCaching: [],
// The media library's files (plan step 5.2): an address never changes meaning
// (/api/media/file/<hash>/<size>), so the cached copy is always right: cache first.
runtimeCaching: [{
urlPattern: ({ url }) => url.pathname.startsWith('/api/media/file/'),
handler: 'CacheFirst',
options: {
cacheName: 'xenia-media',
expiration: { maxEntries: 800, maxAgeSeconds: 365 * 24 * 3600 },
cacheableResponse: { statuses: [0, 200] },
},
}],
},
devOptions: {
enabled: false,