Caching collections in backbone.js?

前端 未结 6 896
暖寄归人
暖寄归人 2021-02-03 12:50

What would be the best way to ensure that my collection stays cached and thereby only gets fetched once?

Should I implement some sort of cache layer? Should I share the

6条回答
  •  有刺的猬
    2021-02-03 13:20

    You can try to save your collection in localStorage. Here is the link ( http://documentcloud.github.com/backbone/#examples-todos ).

    The app uses a LocalStorage adapter to transparently save all of your todos within your browser, instead of sending them to a server.

    I hope it helps :)

提交回复
热议问题