gulp-rails-pipeline icon indicating copy to clipboard operation
gulp-rails-pipeline copied to clipboard

Serving assets from CDN

Open rymohr opened this issue 9 years ago • 5 comments

Is it possible to precompile assets and serve them from a CDN instead? I've been using asset_sync with the default rails pipeline and it's been working great.

rymohr avatar Mar 05 '15 22:03 rymohr

Yeah, definitely possible. I haven't done it yet personally, but here are some resources to get you started.

This option in rev-collector https://www.npmjs.com/package/gulp-rev-collector#dirreplacements should let you get your cdn path in there. There are other gulp plugins for uploading. Here are a couple for publishing to amazon web services:

https://www.npmjs.com/package/gulp-s3-upload https://www.npmjs.com/package/gulp-awspublish

greypants avatar Mar 06 '15 23:03 greypants

As is the project completely ignores asset_host though right?

rymohr avatar Mar 06 '15 23:03 rymohr

Yeah, none of the tasks know about Ruby or Rails.

greypants avatar Mar 06 '15 23:03 greypants

@rymohr Did you find a way of getting the assets from a CDN? From what I get rev-collector only changes files from html templates but we probably need to get other assets referenced on css also.

joaovpmamede avatar Apr 14 '15 08:04 joaovpmamede

@joaovpmamede I haven't actually tried to use this one yet. The project I was hoping to use it for is a production app with 50k lines of js so it won't be an easy migration. Waiting till it's been battle tested a bit more.

rymohr avatar Apr 14 '15 22:04 rymohr