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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With