fix(frontend): Make sw.ts respect to frontend base URL

This commit is contained in:
MidoriKurage
2026-04-20 14:28:23 +00:00
committed by kolaente
parent 3a5ba17ca0
commit e31c45c44e
+3 -1
View File
@@ -21,9 +21,11 @@ workbox.routing.registerRoute(
new workbox.strategies.StaleWhileRevalidate(),
)
// Construct pattern with full base URL
const apiRoutePattern = new RegExp(`${fullBaseUrl.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}api\\/v1\\/.*$`)
// Always send api requests through the network and bypass the browser's HTTP cache
workbox.routing.registerRoute(
new RegExp('api\\/v1\\/.*$'),
apiRoutePattern,
new workbox.strategies.NetworkOnly({
fetchOptions: {
cache: 'no-store',