Open jmealo opened 10 years ago
This seems like a reasonable idea. To achieve this, it looks like we would need to:
Last-Modified
headers to files as metadataIf-Modified-Since
header with Last-Modifier
metadatahttp://www.cyberciti.biz/faq/linux-unix-curl-if-modified-since-command-linux-example/
I believe there is also E-Tag. Also, we would need to be aware of Cache-Control headers.
It is probably best to look for a library to handle all of this for us x_x
I think we should have a look at grunt-sync
Yep, we should be able to use the mtime
property they refer to. This can be altered via
http://nodejs.org/api/fs.html#fs_fs_utimes_path_atime_mtime_callback
For reference, this is the same property rsync
uses in its last-modified
implementation
Considered extended file system attributes to support etag
and such
https://github.com/LinusU/fs-xattr
but I am realizing that is a bad idea because that mutates the original file. We should probably create a secondary file that stores all of this data
// .grunt-curl.cache.json
{
filepath: {
etag: 'abc'
}
}
...but then we get into an issue of potentially having stale data if deletion manually occurs =/
The second half of that idea was inspired by this library which creates double files for each of them which can be ignored by OSX:
It'd be helpful to have an option to download files only if they have been updated/modified.