title: Angular service worker offline caching is not working when I've deployed in server
body: <p>When I built my angular project with angular/pwa and tested it on local server using http-server, it was working as expected. Even offline caching is working fine in local.</p>
  
  <p>But when I've deployed the same thing in server, I was able to install and run it on any device but not able to open when I am offline.</p>
  
  <p>service-workers are not caching the contents in angular pwa</p>
  
  <p>Here's my app.module.ts </p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { HttpClientModule } from '@angular/common/http';
  
  import { AppRoutingModule } from './app-routing.module';
  import { AppComponent } from './app.component';
  import { GetchucknorrisjokesService } from './getchucknorrisjokes.service';
  import { ServiceWorkerModule } from '@angular/service-worker';
  import { environment } from '../environments/environment';
  
  @NgModule({
    declarations: [
      AppComponent,
    ],
    imports: [
      BrowserModule,
      AppRoutingModule,
      HttpClientModule,
      ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
    ],
    providers: [ GetchucknorrisjokesService ],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>
  
  <p>Here's my ngsw-config.json file</p>
  
  <pre><code>{
    "$schema": "./node_modules/@angular/service-worker/config/schema.json",
    "index": "/index.html",
    "assetGroups": [
      {
        "name": "app",
        "installMode": "prefetch",
        "resources": {
          "files": [
            "/favicon.ico",
            "/index.html",
            "/*.css",
            "/*.js"
          ]
        }
      }, {
        "name": "assets",
        "installMode": "lazy",
        "updateMode": "prefetch",
        "resources": {
          "files": [
            "/assets/**",
            "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
          ]
        }
      }
    ]
  }
  </code></pre>