Design comparison
SolutionDesign
Solution retrospective
Hi there, Frontend Community I'm in trouble with JS when I make an API call. Can anybody tell me how I can handle delays after calling the API using fetch?
Community feedback
- @shivaprakash-sudoPosted over 2 years ago
Hello Thih_Nezzy,
The Advice API caches the data for 2 seconds, which is why you're having delays in responses. You can avoid the caching using the following code, as a second argument to the
fetch
method.{ cache: "no-cache" }
Let me know if it doesn't solve the problem.
Marked as helpful2@nobody1234455Posted over 2 years ago@shivaprakash-sudo I solved it bro! Thanks a lot.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord