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?

有帮助吗?

解决方案

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 :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top