Right now, there is a dictionary of Networkings for each base URL that gets accessed. Each one has its own memory cache. These could instead be replaced by a single memory cache in WebDAV where a Networking instance is created for each request. This would consolidate the caches and simplify request creation.
The issue with this is that Networking cancels requests based on the Networking object the request was created on. The return of the image fetch function (which is currently a String with the request ID) would either need to be the Networking itself (from which cancelAllRequests() could be called to cancel its one request), or the URLSessionTask of the request. The latter would be ideal to match the existing WebDAV functions, but would require a modification to Networking itself, as the session property is internal and there is no function returning the task.
Right now, there is a dictionary of
Networking
s for each base URL that gets accessed. Each one has its own memory cache. These could instead be replaced by a single memory cache inWebDAV
where aNetworking
instance is created for each request. This would consolidate the caches and simplify request creation.The issue with this is that Networking cancels requests based on the
Networking
object the request was created on. The return of the image fetch function (which is currently a String with the request ID) would either need to be the Networking itself (from whichcancelAllRequests()
could be called to cancel its one request), or theURLSessionTask
of the request. The latter would be ideal to match the existing WebDAVfunctions
, but would require a modification to Networking itself, as thesession
property is internal and there is no function returning the task.