alexspeller / non-stupid-digest-assets

Fix the Rails 4 asset pipeline to generate non-digest along with digest assets
MIT License
493 stars 87 forks source link

Use symbolic links in place of copying the whole files #33

Open hartator opened 9 years ago

hartator commented 9 years ago

Avoid copying the asset files using symbolic links. Should save both time when deploying and disk space on production severs. Shouldn't impact Nginx or Apache performance.

iRet commented 8 years ago

A good idea!

chewi commented 8 years ago

Apart from being a good idea, this also fixes a weird permissions issue I've seen. I deploy into an environment where we're not supposed to go in as a shared user so group writeable permissions are enforced. This works except for the line being discussed here. Only root or the owner of the file are allowed to modify the atime/mtime to anything other than the current time. If the file was initially created by someone else, it blows up with Operation not permitted. It doesn't matter than you're still allowed to modify or even delete the file itself. See man utime for the formal explanation. Deleting the file first is one workaround and ln -sf effectively achieves this. I have rebased the above commit against current master and it works fine.