Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug ] : can't force my website visitors to get the new version #502

Closed
5 tasks done
moHaHa opened this issue Jun 12, 2023 · 3 comments
Closed
5 tasks done

[bug ] : can't force my website visitors to get the new version #502

moHaHa opened this issue Jun 12, 2023 · 3 comments

Comments

@moHaHa
Copy link

moHaHa commented Jun 12, 2023

Describe the bug

my client open the website the I always update , but he got the old version , I can't force the visitors to get the new versoin without say "hi , please clear cache on you browser or press CRTL + f5 " , and it sometimes works and sometime not

my make this edit

  1. remove pwa.ts to pwa.md (I don't want to delete it )
  2. // import { VitePWA } from 'vite-plugin-pwa'
  // VitePWA({
    //   registerType: 'autoUpdate',
    //   includeAssets: ['favicon.svg', 'safari-pinned-tab.svg'],
    //   manifest: {
    //     name: 'Vitesse',
    //     short_name: 'Vitesse',
    //     theme_color: '#ffffff',
    //     icons: [
    //       {
    //         src: '/pwa-192x192.png',
    //         sizes: '192x192',
    //         type: 'image/png',
    //       },
    //       {
    //         src: '/pwa-512x512.png',
    //         sizes: '512x512',
    //         type: 'image/png',
    //       },
    //       {
    //         src: '/pwa-512x512.png',
    //         sizes: '512x512',
    //         type: 'image/png',
    //         purpose: 'any maskable',
    //       },
    //     ],
    //   },
    // }),

in new website verion the download icon removed from the borwser but how do I clear the cache from the other visitors ?

Reproduction

https://almodonholding.mohaha.me

System Info

chrome , windows

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@userquin
Copy link
Member

If you are removing the pwa just add pwa again adding selfDestroying: true and the sw and the caches will be removed from all clients. Check pwa docs https://vite-pwa-org.netlify.app/guide/unregister-service-worker.html

@moHaHa
Copy link
Author

moHaHa commented Jun 13, 2023

@userquin
I just add the PWA again, with this config line selfDestroying: true
the problems solved: ✅

Thank you very much for the answer 🙏. I would like to sponsor you, but unfortunately, my country (Syria) is blocked from accessing many services, including e-pay.

@moHaHa
Copy link
Author

moHaHa commented Jun 13, 2023

selfDestroying: true solve the issue ✔️

read more : https://vite-pwa-org.netlify.app/guide/unregister-service-worker.html

@moHaHa moHaHa closed this as completed Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants