Pricing Blog

Optimize dynamic data from api calls

  • jehex-1403967960875405393

    Jehex

    3 months ago

    Hi there, Im in the process to optimize the speed of my app, especially the api calls : some take 1 to 2 seconds to load and it's make sometimes the experience of navigation not smooth ( especially when some htlm elements showing or hiding depending of the data return )

    Would like to know if it's still possible to use storage session for dynamic data, for example an api call who return a list of conversation + number of conversations ( chatbot ) and who is store into the session storage. At each " on load " I verify if the number of conversations is egal to the number stored into the cache ( so the user didnt create any conversations ), if yes > I just load the data from the cache if not > I reload the api with the new data.

    Im not sure if it's a good idea as it's complexify a bit more the app. Thanks!