Coder Social home page Coder Social logo

Comments (6)

angelnikolov avatar angelnikolov commented on September 27, 2024

Hey @234akshay, can you provide some snippets of code which led to this?

from ts-cacheable.

234akshay avatar 234akshay commented on September 27, 2024

@Cacheable({
async: true,
maxCacheCount: 1000,
maxAge: 7200000
})
callGetAPI(url: string) {
return this.http.get(environment.apiUrl + url, this.headers())
.pipe(map(
data => {
return data;
}
));
}

// this way i am doing it is correct way?

from ts-cacheable.

angelnikolov avatar angelnikolov commented on September 27, 2024

from ts-cacheable.

234akshay avatar 234akshay commented on September 27, 2024

no i am calling once at a time but after sometime hit same api it is getting empty data because it is coming from cache. i don't know but at same time it is calling only once not twice that i am sure.

from ts-cacheable.

angelnikolov avatar angelnikolov commented on September 27, 2024

Can you check the network tab and confirm that no 2nd request is sent?
It doesn't make sense that just the data is empty and the rest of the payload is the same..
Also you have some other differences in the payload like to and total so I guess that's a new request.
I see that you are using one generic method that you maybe use for all [GET]s. You are also using a maxCacheCount which should cache 1000 calls.
It looks like you are calling different URLs between the first and the second call, and the second payload is coming from the server.

from ts-cacheable.

234akshay avatar 234akshay commented on September 27, 2024

thanks for giving quick reply i check on Monday and give response.

from ts-cacheable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.