I’m using conditional requests with ETags in my latest Rails app to cut down on bandwidth. I noticed that when my Backbone collections got a 304 Not Modified response, they kept being emptied, which is not nice.
After a little research, I found a way to modify them to re-use the same data after receiving a 304.
1 2 3 4 5 6 7 8 9 10 11 12 13
Note that the collection will still trigger a reset event with this technique.