Cache data in enyojs

Hello all,
how to use cache data from response server api?
Thank you.

Comments

  • Can you provide some more details on what you're trying to accomplish?
  • in my app, i need call to server to get data in first time, and i want cache data response for use other time so i cannot call api to get data.
    please help me, thank you.
  • You'll probably want to use local storage for that.

    If I remember correctly, you can override the "fetch" and "fetched" function in the model/collection to check for cached data or save the retrieved data to cache.

    I use lscache to access local storage: http://blog.pamelafox.org/2010/10/lscache-localstorage-based-memcache.html
  • Hi @psarin can you share example overide fetch and fetched with localStorage?
    thank you so much.
  • i using blob in html5 app running in webOS smarttv as examble:

    var blob = new Blob([JSON.stringify(data)]);<br />var blobURL = window.URL.createObjectURL(blob);<br />console.log(blobURL);
    it working in chrome webbrowser and return link with data in response:

    blob:http://tv.xx.com/3bd0e0a0-1e35-4c4d-8a6e-8610b3f922f7
    but when running app in webOS smarttv it return invalid link with absolute path and cannot get data from this link:
    <br />file://com.xxx.app/media/developer/apps/usr/palm/applications/com.xx.app/blob:file%3A/com.vega.app/e29e2035-1d37-4588-918a-f44488e42209
    How to fix it to get data blob link.
Sign In or Register to comment.