Advice generator app with advice slip API
Design comparison
Solution retrospective
Hi everyone✨
I have 2 question:
- How do I make it with
async
function instead of what I'm using? - How to disable caching when I open it in firefox
All feedback are really appreciated! Thank you 🙌
Community feedback
- @elaineleungPosted about 2 years ago
Hi Fathul, great job here with the design, and about your questions:
-
For
async/await
, you can check my solution to this challenge because that's what I used, and I also have error handling in my function. -
About Firefox, I know this too well because I'm a Firefox user and so many of these solutions I see have the caching issue. Most people don't know about it, so I'm glad you know about it and are trying to fix it! You can try adding a request header object to your fetch API, like this:
fetch("https://api.adviceslip.com/advice", { cache: 'no-cache' })
Hope this helps you out!
Marked as helpful2@juancaorgPosted about 2 years ago@elaineleung Lurking other solutions, I was scratching my head on why I was having trouble with my Advice Generator app only on Firefox and finding the solution is just a blessing.
Didn't expect that it was the cache after fetching data.
Thank you, thank you, thank you! 🙌
2@elaineleungPosted about 2 years ago@juancaorg No worries, glad to help! I was once in the same boat as well 😆
2@thefathdevPosted about 2 years ago@elaineleung Wow, really helpful answer, definitely I will use it after writing this reply 😂
Thank you so much for your hard works 🙌
2 -
- @md5daltonPosted about 2 years ago
Another way to disable caching during development is to open the Dev Tools in your browser which can be done in 2 ways:
- Press the F12 key
- Right click anywhere in the web page and select Inspect
Once in dev tools, go to the Network tab and use the Disable Cache toggler to disable or enable cache.
Hope this helps👌
Marked as helpful1@thefathdevPosted about 2 years ago@md5dalton Thank you! really helpful for the development✨
0
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