chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

Access to file timestamp #227

Closed natezeevo closed 6 years ago

natezeevo commented 6 years ago

I can see in the cache database that there is time_stamp for each file entry. Is it possible to access this?

chrisben commented 6 years ago

You must be talking about the hash of each filename that is used to store the cached file. It's not a timestamp. You can retrieve this sha1 hash either by listing all cached file names within the cache folder using Cordova's FileSystem function, or you could also override the hash function ImgCache.overridables.hash to make it store the output hash into an array before returning, this way you will be able to keep track of those hashes if that's your interest.

natezeevo commented 6 years ago

Yes, there is a hash of the filename, but there is also a time_stamp field. I am not sure if this is part of the Cordova FileTransfer function that is accessible though?

screen shot 2018-04-23 at 1 08 03 pm

chrisben commented 6 years ago

This must be some internal meta data stored by Cordova. You'll have more luck looking into its documentation.