Download files conditionally based on server modification
masterYou can optimize builds by only downloading a file if it has changed on the server.
- Use
onlyIfModified trueto check theIf-Modified-Sinceheader. This requires the server to provide aLast-Modifiedtimestamp. - Use
onlyIfModified truein combination withuseETagif the server supports entity tags (ETags).
task downloadFile(type: Download) {
src 'http://www.example.com/index.html'
dest layout.buildDirectory
onlyIfModified true
}