Is there a method to clear Expo cache?

99封情书 提交于 2021-01-29 14:16:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!