How To Clear URLSession Cache

There is a high chance that your app uses some API requests. Even if you use some external library, beneath you use URLSession anyway.

Sometimes you want to cache responses to make the next request faster. However, you might need to remove all caches for example when the user wants to log out or during the development process.

To clear all caches explicitly you can use: