Design comparison
Solution retrospective
After implementation of the fetch() method, I found that if clicking multiple times to generate a new request, the content starts throttling as it changes to the loading message, then it uploads the content from the cache (meaning the text is the same as in the previous advice). Is there any way to avoid this behavior? So, if I click multiple times, every time I click the button, a new request is fetched.
Community feedback
- @invictus1032Posted almost 2 years ago
Yes, add
{cache: "no-store"}
param to yourfetch()
call to prevent caching.Marked as helpful2@mikhailkollenPosted almost 2 years ago@invictus1032 Thank you for the help! I would say it works much better with it. Deleted the setTimeout function, the functionality is pretty straightforward now, without the issue.
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