Search code examples
react-nativereduxexpo

Is there a method to clear Expo cache?


I'm working on a task where I have to update a product images. Expo cache is posing a problem, when I update the product images and re-render the screen it does update my store state but doesn't show it. When I manually cleared expo cache it did work.

I have also tried using the 'Cache-Control' header, but that didn't solve the problem.

Is there a method I can call to clear expo cache ?


Solution

  • As far as I know the only way to clear Expo's cache is to add the -c flag to your expo start command.

    Here's their page on useful commands:

    • expo start -c --localhost --ios

      • start expo server, clear cache, load only on localhost and open on iOS simulator

    I don't think there's a method in their SDK that clears the cache while the app is running like you want to.