DEV Community

Discussion on: The Rails Ecosystem is Healthier than Ever

Collapse
 
matteojoliveau profile image
Matteo Joliveau

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.

Collapse
 
juanmanuelramallo profile image
Juan Manuel Ramallo

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 :/

Thread Thread
 
matteojoliveau profile image
Matteo Joliveau

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