jQuery的$就调用函数是缓慢的第一次 [英] jquery $.ajax function call is slow first time

查看:121
本文介绍了jQuery的$就调用函数是缓慢的第一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用$就来更新数据库中的值。当页面使Ajax调用的第一次,它是缓慢的。它正在像5或6秒钟将返回结果。在第一次请求之后,它是快速。我不知道是否有一种方法,使第一个电话也快。如果您有任何意见,请让我知道。

I am using $.ajax to update some values in the database. when the page makes the ajax call for the first time, it is slow. it is taking like 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 fast. if you have any ideas, please let me know.

谢谢, 斯里达尔

推荐答案

我的怀疑是,该数据库是做一些缓存和后续请求从缓存中填充的。如果这是仅发生在数据的第一请求,而不管所涉及的数据,然后我会怀疑是你连接到需要的web服务也可以加载到存储器上的第一操作

My suspicion would be that the database is doing some caching and subsequent requests are filled from the cache. If this were only happening on the first request of the data, regardless of the data involved, then I would suspect that the web service that you're connecting to needs to be loaded into memory on the first operation.

这篇关于jQuery的$就调用函数是缓慢的第一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆