问题
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 ?
回答1:
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.
来源:https://stackoverflow.com/questions/55868539/is-there-a-method-to-clear-expo-cache