Jquery $ .ajax function call is slow for the first time

I use $ .ajax to update some values ​​in the database. when the page makes an ajax call for the first time, it is slow. It takes 5 or 6 seconds to return the result. after the first request, it is fast. I am not sure if there is a way to make the first call also quickly. if you have any ideas please let me know.

Thank you Sridhar

+3
source share
8 answers

My suspicion would be that the database does some caching, and subsequent requests are populated from the cache. If this happened only during the first data request, regardless of the data, then I would suspect that the web service with which you are connecting should be loaded into memory during the first operation.

+2
source

What type of service is a method call? This is probably a service that it invokes more slowly, not jQuery.

+1
source

Fiddler IE Firebug firefox /. , .

+1

ajax ASP.NET? , , , ASP.NET, .

0

script. John , jQuery .

0

. , . , . , , . , document.ready webservice . . -, asp.net. - asp.net. firefox , .

, .

0

IE7, - IE7. , jquery get/ajax , .

, , .

, ( ) , , .

0

ASP.NET

, . JIT , , -.

In other words, This happened only when you set the release flag for "Debugging" in an ASP.NET application. If you set it to "Release", you will find that this is only the first time for each requested URL that will be slow, but in next time will be awesome.

(English is not my native language)

0
source

Source: https://habr.com/ru/post/1702431/


All Articles