1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

angular pwa returning 504 even thought it can work offline properly

Discussão em 'Angular' iniciado por Robert, Outubro 14, 2024.

  1. Robert

    Robert Guest

    I have an Angular application with @angular/pwa

    here is the ngsw-config.json

    {
    "$schema": "../../node_modules/@angular/service-worker/config/schema.json",
    "index": "/index.html",
    "navigationRequestStrategy": "freshness",
    "assetGroups": [
    {
    "name": "app",
    "installMode": "prefetch",
    "resources": {
    "files": [
    "/favicon.ico",
    "/index.html",
    "/manifest.webmanifest",
    "/*.css",
    "/*.js"
    ]
    }
    },
    {
    "name": "assets",
    "installMode": "lazy",
    "updateMode": "prefetch",
    "resources": {
    "files": [
    "/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
    ]
    }
    }
    ],
    "dataGroups": [
    {
    "name": "api",
    "urls": ["/api"],
    "cacheConfig": {
    "maxSize": 1000,
    "maxAge": "30d"
    }
    }
    ]
    }


    how if I lost connection and I return to the pages I was using all is good and working

    but the problem is when I refresh I get 504 and I don't understand why since the pages can work offline properly if I don't refresh, this happen to both pages requiring api call and static pages, I have SSR enabled in the project and these static pages are prerendered

    Continue reading...

Compartilhe esta Página