Ionic PWA Firebase

I have a pwa application deployed to firebase. Why must we clear cache to see the changes? Is there any way without clearing the cache?

You can do something like this when you have a service worker update available.

  constructor(
    private swUpdate: SwUpdate,
    private toastCtrl: ToastController
   ) {...}

  ngOnInit() {
    this.swUpdate.available.subscribe(async () => {
      const toast = await this.toastCtrl.create({
        message: 'Update available!',
        position: 'bottom',
        buttons: [
          {
            text: 'Reload',
            role: 'cancel',
          },
        ],
      });
      await toast.present();
      toast
        .onDidDismiss()
        .then(() => this.swUpdate.activateUpdate())
        .then(() => window.location.reload());
    });
  }

Can i update without giving information?

Are you sure you need to clear cache? Or just have to reload?

You need to reload because it’s a web app, and you just deployed an update so your user needs to reload the browser to see it.

But I don’t think they need to clear cache, since a new version uses a different hash for the file names which makes the browser think they’re different files and re-downloads them instead of getting them from cache. (Unless I’m missing something?)