Skip to content
  • Nicolás Alvarez's avatar
    staticweb: avoid transferring unchanged files to the webserver · 8977fad0
    Nicolás Alvarez authored
    Since we're building websites from scratch on clean environments, even
    cloning the git repository every time, every file will have a recent
    modification timestamp. This means rsync will copy every file to the
    webserver even if it didn't actually change. Also, clients making
    conditional requests with If-Modified-Since will get the whole file
    rather than 304 Not Modified.
    
    For example, any tiny typo fix in kde.org will touch every page and image
    in it, and the hackergotchi images in planet.kde.org will have their
    modtime touched every hour.
    
    This commit adds -c / --checksum to the rsync command. It makes rsync
    calculate the hash of the local and remote file, and transfer it only if
    it actually changed, rather than only comparing size and modtime. That way
    if a file didn't change in the source git repository, or if the generation
    process created an file identical to the previous version, it will not be
    updated during deployment.
    8977fad0