简体   繁体   中英

How to avoid 304 not modified in rails4, ajax not working

I'm a beginner in rails and making a simple application with it. But every time I refresh or reload a page, it returns 304 not modified status, and ajax doesn't work at all! It really bothers a lot. I have set config.action_controller.perform_caching = false and added $.ajaxSetup({cache: false}); and even Cache-Control:no-cache to the application.js.
It just can't work.
Is there any effective way to make ajax working?

Remove Turbolinks from your project. You need to do couple of steps:

  • remove turbolinks gem from Gemfile
  • remove requires from application.js and application.css
  • remove data-turbolinks-track from you application layout file

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