diff --git a/docker-compose.yml b/docker-compose.yml index be62842..bcf60e9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: # ========================================== # Router público para recursos PWA (sin autenticación) # ========================================== - - "traefik.http.routers.musica-nucleoriofrio-public.rule=Host(`musica.nucleoriofrio.com`) && (PathPrefix(`/_nuxt`) || PathPrefix(`/assets`) || Path(`/sw.js`) || PathPrefix(`/workbox-`) || Path(`/manifest.webmanifest`) || Path(`/manifest.json`) || Path(`/favicon.ico`) || Path(`/logo.png`) || Path(`/logo-192.png`) || Path(`/logo-512.png`) || Path(`/logo-maskable-512.png`) || Path(`/icon.svg`))" + - "traefik.http.routers.musica-nucleoriofrio-public.rule=Host(`musica.nucleoriofrio.com`) && (PathPrefix(`/_nuxt`) || PathPrefix(`/assets`) || Path(`/sw.js`) || PathPrefix(`/workbox-`) || Path(`/manifest.webmanifest`) || Path(`/manifest.json`) || Path(`/robots.txt`) || Path(`/favicon.ico`) || Path(`/logo.png`) || Path(`/logo-192.png`) || Path(`/logo-512.png`) || Path(`/logo-maskable-512.png`) || Path(`/icon.svg`))" - "traefik.http.routers.musica-nucleoriofrio-public.entrypoints=websecure" - "traefik.http.routers.musica-nucleoriofrio-public.tls.certresolver=letsencrypt" - "traefik.http.routers.musica-nucleoriofrio-public.priority=100" diff --git a/nuxt.config.ts b/nuxt.config.ts index 7a5fe4f..281997c 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -62,6 +62,24 @@ export default defineNuxtConfig({ '_nuxt/builds/**/*.json', ], runtimeCaching: [ + // Nuxt build metadata: Network-Only with graceful fallback for offline + { + urlPattern: /\/_nuxt\/builds\/(meta|latest)\/.*\.json$/, + handler: 'NetworkOnly', + options: { + plugins: [ + { + // Fail silently when offline - these are HMR/build metadata files + handlerDidError: async () => { + return new Response(JSON.stringify({}), { + status: 200, + headers: { 'Content-Type': 'application/json' } + }) + } + } + ] + } + }, // Static images: Cache-First (offline-ready) { urlPattern: /\.(png|jpg|jpeg|svg|gif|webp|ico)$/, @@ -197,7 +215,9 @@ export default defineNuxtConfig({ // Nitro configuration for proxy support nitro: { experimental: { - wasm: true + wasm: true, + // Disable payload extraction in SPA mode to avoid build metadata fetches + payloadExtraction: false }, prerender: { crawlLinks: true, @@ -206,6 +226,14 @@ export default defineNuxtConfig({ // Development configuration for proxy devProxy: process.env.NODE_ENV === 'development' ? {} : undefined }, + + // App configuration + app: { + // Disable build manifest fetching in production + buildAssetsDir: '/_nuxt/', + // Disable automatic payload extraction + keepalive: false + }, // Runtime configuration runtimeConfig: {