fix: service worker improvements for PWA reliability (#127)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-02-13 23:43:29 -05:00
1 parent 79b034d3ba
commit 626e2b1954
13 files changed
+51 -2879

No files matched your search

+9
View File
@@ -269,6 +269,15 @@ app.all('/api/opencode/*', requireAuth, async (c) => {
const isProduction = ENV.SERVER.NODE_ENV === 'production'
if (isProduction) {
app.use('/*', async (c, next) => {
await next()
if (c.req.path === '/sw.js') {
c.res.headers.set('Cache-Control', 'no-cache, no-store, must-revalidate')
c.res.headers.set('Pragma', 'no-cache')
c.res.headers.set('Expires', '0')
}
})
app.use('/*', serveStatic({ root: './frontend/dist' }))
app.get('*', async (c) => {