0

I have deployed the SPFx solution on SharePoint. Changes are not updated until we hard refresh the page.

Need the solution for auto refresh the site page.

2
  • Did you update your solution's version number? Sep 26, 2022 at 10:08
  • Updating the bundle won't change any already loaded instances. You need to tell the browser to go and retrieve them (refresh). There's nothing built into SPFx for this. You could likely build your own system for detecting when an update is available and either prompt the user to refresh or refresh from code but that isn't a standard feature. Sep 26, 2022 at 13:20

1 Answer 1

0

From my experience, there is no need for a hard refresh as long as you follow these steps:

  • In the package-solution.json increment the the number in the version property
  • run gulp clean ; gulp bundle --ship ; gulp package-solution --ship to build a new package
  • Upload a new sppkg file to the app catalog.
  • Make sure a new app version is deployed
  • Done

As long as you change the bundle version, the URL of your bundle will change, thus your browser won't use a cached bundle. If you do not increment the version, then your browser will have no way of knowing that it needs to grab a new version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.