PRX/PRX.org-Frontend — pull request #123 by chrisrhoden (2014-10-14 21:37:29+00:00)
Title: Cache assets between deploys

This speeds up deploys considerably by caching the minified assets.

There is a concern, though, that changes may not be picked up because it just
uses timestamps. As a result, we manually set the timestamps of files generated
by the build process into the cache to be the timestamp of the commit being
deployed.

This could cause problems if file timestamps are dramatically behind the commit
timestamps (the specific case involves a deploy happening between a file
being created and that file being committed for the first time) but this can
be addressed in the future by first touching the source assets with the commit's
timestamp which, while I am not yet doing, should protect us completely.

I'd also like to consider using a copy instead of the symlink used here because
there are definitely race conditions at play if multiple deploys are happening
simultaneously.