re: The Rails Ecosystem is Healthier than Ever VIEW POST

VIEW FULL DISCUSSION

πŸ˜„ A shout-out to ActiveStorage! Rest in peace paperclip, carrierwave and others πŸ’€

dev.to is still on carrierwave 😱

Promise we'll get to 5.2 soon!

Carrierwave is still much better than ActiveStorage in some circumstance. You don't need two extra queries to get assets of an object, f.e.

As much as I like ActiveStorage. it has its shortcomings too, i.e. no nested directories:

github.com/rails/rails/issues/32790

Some people seem to like Shrine a lot, but I didn't get a chance to try it out yet.

I still have problem understanding why no nested directories. It was a big "no" without explanation.

I love ActiveStorage too, I use it on my personal website and on all new projects at work.
But one major shortcoming I found, and something I hope will be addressed/changed in future versions, is that images cannot be cached by CDNs. I have CloudFront and CloudFlare caching static assets, but I had to exclude images because ActiveStorage generates 5 minutes-lived URLs from the backing service, and after 5 minutes if the cache tries to refresh itself it returns a 404 error.

As you can see in this issue on GitHub, it is a common concern.

Yeah I faced the same issue with no success :(
How did you work around it?
Seems like ActiveStorage was planned for files rather than for images :/

Well... I didn't ahah
We're just avoiding caching images, inefficient but at least it works. I hope they'll fix it soon

code of conduct - report abuse