@PatrickLee22
Posted
Hello there 👋. Congrats on completing the challenge!
To resolve the caching issue, you can set the cache option in your fetch call to 'no-cache' to prevent the browser from caching the response, like so:
fetch('https://api.adviceslip.com/advice', {cache: "no-cache"})
Alternatively, the Advice Slip API has an option to get a specific advice slip if you provide an id number at the end of the URL. You could append a random number to the URL and it which would bypass the caching on the server side.
Marked as helpful
@PatrickLee22 Thank you for the explanation! Both are great solutions.
@PatrickLee22
I tried marking your suggestion as helping but I wasn't able to. your no cache method is golden. Thanks!!
@PatrickLee22
Posted
@ifaronti I appreciate the thought regardless. Glad I could help.