audio streaming app plyr.fm
38
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: bypass service worker for audio to prevent iOS PWA hangs (#466)

audio streaming was intermittently hanging in iOS standalone (PWA) mode.
the service worker was intercepting /audio/{file_id} requests with
NetworkFirst caching, which caused issues with:
- 307 redirects to R2 CDN getting cached/stale
- range request headers not being handled properly on iOS Safari

switched to NetworkOnly for audio routes so the SW passes through
without interference. we weren't actually caching audio files anyway
(just the redirect response), so there's no functional loss.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>

authored by

nate nowack
Claude
and committed by
GitHub
31b4621a 45feff7c

+6
+6
frontend/vite.config.ts
··· 13 13 globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'], 14 14 runtimeCaching: [ 15 15 { 16 + // audio streaming: bypass SW entirely to avoid iOS PWA hangs 17 + // (the redirect to R2 CDN + range requests don't play well with caching) 18 + urlPattern: /^https:\/\/api\.plyr\.fm\/audio\/.*/i, 19 + handler: 'NetworkOnly' 20 + }, 21 + { 16 22 urlPattern: /^https:\/\/api\.plyr\.fm\/.*/i, 17 23 handler: 'NetworkFirst', 18 24 options: {