Skip to content
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

Cache clearing #23

Open
ericalas93 opened this issue Aug 27, 2023 · 3 comments
Open

Cache clearing #23

ericalas93 opened this issue Aug 27, 2023 · 3 comments

Comments

@ericalas93
Copy link

ericalas93 commented Aug 27, 2023

Is there a recommended way to clear the cache? I have tried
URLCache.shared.removeAllCachedResponses() but noticed that when I go to settings -> storage -> my app, Documents & Data it doesn’t go down.

My apologies if this is a silly question, rather new to iOS development, thanks for a great library!

@neoighodaro
Copy link

+1. Is there a possibility for this? I would like to add a clear cache option in the app, and this would help a lot.

@LoopingStudio
Copy link

LoopingStudio commented Oct 13, 2023

If you use the extension

extension URLCache { static let imageCache = URLCache(memoryCapacity: 512*1000*1000, diskCapacity: 10*1000*1000*1000) }

You can do URLCache.imageCache.removeAllCachedResponses() and it seems to be working

@neoighodaro
Copy link

Thank you kind person!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants