What is the difference between Shared URLSession and URLSession with default configuration?
In my app i was using URLSession.shared to send a request to server. Now i'm trying to change it to URLSession.init(configuration: URLSessionConfiguration.default).
But if i use URLSession.init(configuration: URLSessionConfiguration.default) all my request are taking more time to load.
Compared to URLSession.shared, URLSession.init(configuration: URLSessionConfiguration.default) is taking more time to load the request.(Shared Session is 5 to 10 time faster than URLSession with default Configuration).
What is the Difference between these two methods?
Why URLSession With Default Configuration is taking more to load the request?
In other words, if you’re doing anything with caches, cookies, authentication, or custom networking protocols, you should probably be using a default session instead of the shared session.
For more info: https://developer.apple.com/documentation/foundation/urlsession/1409000-shared
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