Is it possible to clear the URL Cache for just one url and not the whole cache? I have already tried this put it does not seem to do anything.
let url = URL(string: "https://example.com")!
let request = URLRequest(url: url)
URLCache.shared.removeCachedResponse(for: request)
You can try make request to some url with different cache policy like reloadRevalidatingCacheData which will delete all cache for this url.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With