0

My Backbone web app doesn't properly reload collections from the server after logout followed by a login. It appears that this is because the associated API calls are being cached so when a new user logs in, they will see some of the previous user's data if the page isn't refreshed.

If I call collection.reset at logout for one such collection, the data is at least cleared for the next user, but their own data in that collection still isn't being loaded. Does anyone have an idea of how to prevent the requests from using the cache?

Adam Fraser
  • 6,255
  • 10
  • 42
  • 54
  • 1
    Have you tried using [`$.ajaxSetup`](http://api.jquery.com/jQuery.ajaxSetup/) to set `cache: false` on all `$.ajax` calls? – mu is too short Sep 04 '12 at 17:41
  • Great advice, mu. Thanks! Unfortunately I wasn't able to test it out since we decided to shelf this problem for the moment. – Adam Fraser Oct 08 '12 at 17:46

0 Answers0