File dates in /static

I noticed that files in /public/static doesn’t keep the original files creation/modification date. This makes my S3 client (Transmit) unhappy since it uses the date to determine if files can be skipped, meaning that it always re-uploads everything.

Dove into some code and found that mostafah/fsync is used for syncing the directories and it doesn’t seem like it has any support for keeping the file dates.

Hasn’t anyone else noticed this? Wouldn’t it be better to keep the file dates?

According to the fsync-doc: “Consequent calls will only copy changed or new files”.

You sync to s3 using /public (or whatever folder you build to). The static files in /public will have different mod dates than in /static - but does that matter if it only changes if the file changes?

EDIT: It would matter if you clean your /public before each publish (like I do).

Exactly. I don’t see any reason why the date shouldn’t be preserved, it would be more consistent and easier to deploy from different machines (for instance).

We should preserve as many of the attributes as we can

1 Like

Got a reply from the author of fsync:

This was implemented by the author of fsync:

1 Like

Awesome. Thanks for driving this.

Added pull request to add a noTimes config setting, which is used to set the bool you are referring to in the fsync.Syncer struct.