Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4 assets manifest.json recent digest

I have a few manifest files with digest on the deploy server

manifest-bcba79cf9483d404e9951992bbe38e46.json
manifest-7db402a1216c2425e0f881b6331ba27d.json
...

How sprockets know which of manifests is recent? Or it should be only one manifest file?

Regards

like image 731
Valikos Ost Avatar asked Oct 01 '22 14:10

Valikos Ost


1 Answers

the manifest.json always has a random SecureRandom.hex(16) attached to it's name. Taking a look at manifest you can see that Sprockets takes the first available file.

If you see multiple manifest-*.json files on your server, it might get risky since Sprockets doesn't really choose the newest file and you may end up with loading outdated assets.

Just run the following and you're good to go:

bundle exec rake assets:clobber
bundle exec rake assets:precompile
like image 119
Yan Foto Avatar answered Oct 18 '22 15:10

Yan Foto