I'm running the google pagespeed test on my (test) web made with rails and deployed on heroku.
It shows me a warning about the javascript and css files that are blocking the half top content of the page.
So the main suggestion is to made the javascript files load async, and to put the css files after the tag. I did it and now the files I changed to async and moved to the end are not shown in the warning, but I still see two files that I don't know how to change:
https://foo.herokuapp.com/assets/application-08af52LotOfnumbersAndLetters.js
https://foo.herokuapp.com/assets/application-08af52LotOfnumbersAndLetters.css
This are the files generated by rails from my assets, they are not loaded by a script or style tag, so as far as I know, I can't move the css or made the js async.
Is there a way to pass the speed test with this files?
Im using rails 5.0.0.1
Edit: I don't find neither how to set the browser cache with the 'expire' in rails. And that's another warning I see.
Edit 2: Now I see in console that the rails javascript asset that I don't know to change to async is loading before the materialize.js that I changed to async, so the functions of materialize are not declared when the rails javascript asset loads and calls them, and there is an error.
Edit 3: It seems that adding a line to the config/initializers/rails_admin.rb it works. If somebody finds the same problem, you only have to add:
config.parent_controller = 'ApplicationController' I think it is due to: rails_admin do not use application_controller if you do not tell him to do it, so application_controller does not catch the exception of rails_admin.