: How can I version-control and deploy a website's static files while preserving timestamps? I'm using NanoBlogger to generate a website that consists entirely of static files—no PHP or anything
I'm using NanoBlogger to generate a website that consists entirely of static files—no PHP or anything similar.
I'd like to place the site under version control, which means managing both NanoBlogger's data files and the other non-generated files (stylesheets, images and whatnot) that make up the site with one revision-control system or another. I'd also like to automate deployment of the website from the RCS.
What I've discovered is none of the modern revision-control systems (git, Subversion and Mercurial) preserve timestamps on files they manage. This means a deployment script on the server that checks out a fresh copy of the repository and copies the files over to the webserver's public folder will end up resetting the timestamp on every file, even things like images that haven't changed. This defeats any attempt to use caching effectively and ends up wasting users' time and bandwidth.
So my question is, what tools and workflow do people actually use for versioning and deploying static websites? Specifically, how you get around the timestamping issue? Do you
simply keep a "permanent" checkout of the repository on the server which just gets updated before each deployment (arguably a bad practice),
use a "classic" RCS like CVS that does preserve timestamps, or
ignore the problem and accept a bit of bandwidth will be wasted?
Or is there some completely different kind of system or workflow people use instead?
(There's no shortage of information on the mechanics of using revision control with a website, but I've yet to see anyone address the timestamp issue or say much about static websites specifically.)
More posts by @Murphy175
1 Comments
Sorted by latest first Latest Oldest Best
No VCS includes timestamp as metadata, even some do include permission bits. I think it's because when VCS tracks file contents, the last-modified time is not coherent. E.g. when someone modify a file, then undo, the last-modified time changes, but that file should keep the same version.
BTW, Subversion has an option use-commit-times to use commit time as file timestamp. Thus it could help a bit.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.