Closed smarkars closed 6 years ago
Hey @skartys thanks for the kind words!
I've thought about implementing this, but ultimately felt like it goes a bit out of Disk's scope.
Let's say we have a struct called Document
and we give this struct a Date
variable called expirationDate
.
struct Document {
let title: String
let expirationDate: Date
}
So the way expiry would work on iOS would require us to basically (1) iterate through all our Document
s and (2) find those whose 'expirationDate' date value is before today, and then (3) delete those Document
s. All this could be done, for example, when the application launches (so in didFinishLaunching
in your App Delegate.)
This kind of practice is best accomplished tailored to your own specific needs, i.e. you could create a folder called DocumentsThatWillExpire
and simply follow ^ steps to manage your expired files. This ensures good performance, as iterating through the entire file system would be thread intensive.
Hi I'm using this library in my application and it's wonderful.
Just wondering can we have expiry setting for objects that are added to cache.
Thanks.