mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
fix: service worker improvements for PWA reliability (#127)
This commit is contained in:
1 parent
79b034d3ba
commit
626e2b1954
13 files changed
+51
-2879
No files matched your search
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user