dimanche 5 novembre 2023

Loading slow-executing server scripts via AJAX

I have a server script that requests a delivery price calculation result from my delivery provider. To do so it has to execute several HTTP requests requests so it is rather slow. I'm caching calculation result with redis but when the page with detail product information loads for the first time it takes almost a second.

So I thought that maybe I can load calculation result indepentently from main execution thread via AJAX.

Is it okay to do so in terms of web app design? I mean I really don't like an idea of two requests from one page just to load it but in fact I don't see any alternatives cause I'm unable to speed up calculations.

Thanks for sharing thoughts.

Aucun commentaire:

Enregistrer un commentaire