Rails: Serve Compressed Static Assets from Cloudfront

I am using Rails 4 and my application is deployed to Heroku.

I am trying to transfer compressed assets from Cloudfront. The Cloudfront distribution origin points to Amazon S3, where there is a compressed version of js and css.

However, these compressed assets are not served by Cloudfront. I read these gems like heroku-deflaterand rack-zippy work, but they will serve assets from Heroku, not serve them from Cloudfront. In other words, I need mine to config.serve_static_assetsbe false, as I want Heroku not to service the assets.

How can I service squeezed assets?

+4
source share
1 answer

Why not transfer them from Heroku? Listen to me:

, URL- Heroku . config.asset_host = 'http://abcd12345678.cloudfront.net'. , Cloudfront , , Heroku. , Heroku ( CloudFront)

0

All Articles