New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebView still reads resources from the cache with cacheEnabled={false}
#880
Comments
Found anything @ajcrites ? |
+1 |
@kabus202 @cesar3030 my issue was a little different I think, I had troubles using initial-scale in meta tag html to rescale the html but I fixed it with a native patch since it turned out this was not a cache issue. |
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
+1 |
I can confirm the issue is still there. |
Its still the issue |
+1 |
issue is still there |
The only way to prevent cache is to add: ?<Random string, time seconds whatever> |
maybe you should give a try for |
I try cacheEnabled={false} and cacheMode={'LOAD_NO_CACHE'}. It is work in android, but ios not working. Then I try incognito={true}. |
Even with the following props set on iOS the WebView still seems to read from cached results :/ it does seem to function properly on Android iOS v14.5 cacheEnabled={false} |
Anita has a great answer on StackOverflow where she creates an iOS Native Module and bridges it into RN to manually clear the WebView cache: |
You can clear the webview cache as already suggested in prior comments or simply add a time tag to the uri as a workaround e.g.: |
Thank you @digitalhuman, this was the way for me! In my case I needed to integrate a chat widget which uses cookies or localStorage to keep track of the session even if you close the window. This meant that after the webpage had been loaded once even with Simply appending a unix timestamp to the URI ( |
Bug description:
If you have a WebView component with
cacheEnabled={false}
, the WebView will still get resources from the memory cache.To Reproduce:
Create a component with
<WebView cacheEnabled={false} uri={{ ... }} />
. The URI should be to a website with resources that may be cached such as CSS files.Expected behavior:
Web resources should neither be cached nor read from the cache. If you update a CSS file and revisit the corresponding page in a WebView, it should download the new resources.
Screenshots/Videos:
Safari Developer tools show the page reading resources from the Memory Cache. This happens even if you go to Develop > Empty Caches in Safari.
Environment:
The text was updated successfully, but these errors were encountered: