reyesoft / ngx-jsonapi

JSON API client library for Angular 5+ 👌 :: Production Ready 🚀
https://ngx-jsonapi.reyesoft.com/
MIT License
101 stars 52 forks source link

How to enable caching? #172

Closed a-radys closed 5 years ago

a-radys commented 5 years ago

I tried to do the opposite from this issue: https://github.com/reyesoft/ngx-jsonapi/issues/130 and changed false to true like this:

    NgxJsonapiModule.forRoot({
      url: '/',
      cache_prerequests: true,
      cachestore_support: true
    })

but all the http requests are sent every time, like the cache is not working. Should I set something more?

maxi7587 commented 5 years ago

Hi aradys, have you set ttl in the resources that are not being cached?

a-radys commented 5 years ago

Setting ttl solved the problem, thanks!