Pregunta

I run rake assets:precompile when I am adding a new commit up to my heroku site. However, is there any use in running this after I change my stylesheets? I use shift+control+r in Chrome to reload the page and override the cache. Will running rake assets:precompile before running the server make overriding the cache unnecessary?

¿Fue útil?

Solución

Once you do rake assets:precompile in production after changing some asset files, the files which have changes will be generated with a different fingerprint, thus serving fresh content invalidating the cache. So, there is not need of shift+control+r anymore.

Fingerprinting is enabled by default in Rails. When fingerprints change, client will request updated files from server and will load it on the client side.

To know more about Fingerprinting, refer here

Hope it helps :)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top