1

I want to retrieve the data from a cached URLResponse as a local URL or path instead of the Data object in memory.

Is this possible? I know that URLCache puts its data inside a Cache.db file somewhere...

Background: I want to use URLCache as my app's cache solution and be able to quickly open QLPreviewController to show files. A workaround would be to copy the data to a temp file but I want to know if there's a direct way.

heyfrank
  • 5,291
  • 3
  • 32
  • 46
  • You can use a [downloadTask](https://developer.apple.com/documentation/foundation/urlsession/1411608-downloadtask)? That will download to a file and give you the URL to the corresponding local file. – Rob C Jun 23 '20 at 12:10
  • @RobertCrabtree I updated my question with background info. Basically I want to know if there's a direct way to obtain the path or local url. – heyfrank Jun 23 '20 at 12:25

0 Answers0