Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does changing config.assets.version number do?

What does changing config.assets.version number do?

I understand that the assets expire (as it is written in the comments) but what does it do in the background?

would it delete all the compiled assets? or does it take that version number and uses it somewhere else?

like image 233
Nick Ginanto Avatar asked Nov 01 '12 05:11

Nick Ginanto


People also ask

What does rake assets Precompile do?

rake assets:precompile. We use rake assets:precompile to precompile our assets before pushing code to production. This command precompiles assets and places them under the public/assets directory in our Rails application.

How does asset pipeline work?

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.

What is the command for Precompiling assets before deploying a Rails app?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.


1 Answers

It will precompile assets with another fingerprints (the code appendend to the file name), making all the client's browsers download the files again.

In other words, as you said, it expires the caches in the client's browsers.

like image 64
hsgubert Avatar answered Oct 14 '22 23:10

hsgubert