Advice generator using JS - Fetch API

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?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @shivaprakash-sudo
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 helpful
Join 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