Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

my responsive advice generator app

#cube-css#node#styled-components#web-components#svelte
Kyureus• 160

@Kyureus1

Desktop design screenshot for the Advice generator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


when you inmediately click on the button after the advice shows up on the screen, it flashes and shows the same advice, it takes like a 2 or 3 seconds delay to show a new one, if you click on the button during these time, it will not change. I couldn't find out how to help that, i want the request to be faster and smoother. i will be checking some other solutions to see if i can do it.

Community feedback

M• 920

@Dev-MV6

Posted

Just in case you need it in the future...

You can control HTTP cache with the Cache-Control header:

  • Using the Fetch API:
fetch(url, { method: "GET", cache: "no-cache" });

You should give this article a read, it will give you a better understanding of how HTTP caching works: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching

Marked as helpful

1

@DennyIsNaive

Posted

This problem is not your fault. Rather data is being stored (cached for a period of 2 to 3 seconds). This problem is inherent from the API and is even specified in the documentation. To resolve this, you might have to use another API or you can set the cached state to no-cache explicitly so no data is cached at all.

Marked as helpful

1

Kyureus• 160

@Kyureus1

Posted

@DennyIsNaive thanks god it wasn't me, is it possible for me to change the cached state you mention and how?

0

Please log in to post a comment

Log in with GitHub
Discord logo

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