react native expo app not loading the changes util hard refresh in the browser

Viewed 209

I have a react-native expo app hosted on a Heroku platform.

The issue is when ever I do any changes to the app and deploy to the server, I am not able to see those changes in the browser (chrome/firefox or safari) until I do a hard refresh on the browser.

After I do the hard-refresh, I am able to view my changes.

I am looking for any solution to reload the changes without a hard-refresh in the client browsers.

I tried a couple of ways but could'nt resolve it.

  1. I tried NOT to cache the root(/) or home-page(index.html) so that it will try to hit the server to get the home-page but didn't worked.

I have below configuration in static.json within the react-native app https://github.com/heroku/heroku-buildpack-static#configuration

{
  "root": "web-build/",
  "clean_urls": false,
  "routes": {
    "/**": "index.html"
  },
  "headers": {
    "/": {
      "Cache-Control": "max-age=0, no-cache, no-store, must-revalidate"
    },
"/index.html": {
      "Cache-Control": "max-age=0, no-cache, no-store, must-revalidate"
    }
  }
}

When I tested the expo app, it still caching and not loading the changes that I made.

Appreciate any help to this issue ? (loading changes without a hard refresh in browsers)

0 Answers
Related