简体   繁体   中英

None of js files gets loaded when a page is loaded for the first time

There is a link on a page. When I click on it I, indeed, get redirected to another page. But for the first time (when the referral in another page with the link) none of the js file load. None at all. Only when I reload it manually or type in the link in the address bar, then all the js files load normally. But for the first time - not.

It happens on both development and production environments. I suspect that caching might be a cause but some js files remain having "304 Not modified" even after reloading (some do not, though).

I use turbolinks if this matters.

What's the matter?

Assuming you're using the Asset Pipeline you can try incrementing the version of your assets by setting config.assets.version to something new (in config/application.rb). This should expire all of your existing assets and force new ones to be downloaded by your browser (and the browsers of all of your users too!).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM