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

[feature] Consider an option of using symlinks instead of copies #17

Closed rubyconvict closed 10 years ago

rubyconvict commented 10 years ago

When having hundreds of files this matters in terms of speed and hard disk activity, plus, it would save some disk space.

wuservices commented 10 years ago

This seems like a good idea. I wonder if this would have issues in any environments, so as you mentioned, it would be good as an option but maybe not as as default.

alexspeller commented 10 years ago

I would accept PR adding this as a non-default option.

tvdeyen commented 10 years ago

I also don't think symlimks is a good idea and would bring a big performance boost. One really should use the file exclude option, so only the assets, that need to have non digest version, get copied over.

wuservices commented 10 years ago

In my case, I'm copying everything so that there's a predictable fallback when an asset with a digest that doesn't exist is requested. While keeping 3 versions back definitely mitigates this issue, I still run into it because my Rails assets and manifests are used (and somewhat cached) by other applications. Therefore, it's even more possible for users to request a file the doesn't exist.

When I see a request for an asset that returns a 404, I have the load balancer redirect the user to the non-digest version and return a relatively short Cache-Control header so the user will stay up to date and their browser won't be completely broken (assuming no super crazy changes were made).

mikeatlas commented 10 years ago

+1