cuzox
cuzox

Reputation: 794

Should I use Sprockets in Rails?

When I'm testing my app on a vps through sublime and sftp, these Sprockets cache files always take forever (figuratively) to sync. What are the consequences of disabling Asset Pipeline? Will my app perform noticeably poorly?

Upvotes: 0

Views: 151

Answers (1)

wpp
wpp

Reputation: 7303

What are the consequences of disabling Asset Pipeline? Will my app perform noticeably poorly?

Yeah, the asset pipeline is there for a reason, quoting the guide:

The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB.

The concatenation of assets leads to fewer HTTP requests (connection setups) which is, at least for HTTP 1.1 considered as a best practice. Minification speaks for itself I guess. Take a look at the guide to get a full grasp of the consequences.

I'm not sure what exactly you mean with sprocket cache files and which environment (as in Rails.env) you're using on your VPS.

You can also compile the assets on the VPS, which might be quicker than uploading. (See compile/precompile section in the guide).

For testing purposes you could also run in the development environment, where the assets will be compiled on demand.

Upvotes: 1

Related Questions