[英]how can i load my page faster with $.ajax() or $.post()
i am trying to load database values from 6 - 7 tables on a single page ie users, their post eg with $.load(); 我试图在单个页面上从6-7个表加载数据库值,即用户,例如$ .load()的帖子; and it is taking from 15+ seconds to load but i want to load that page from 1-5 seconds ...i know it depends on internet connection speed but how can i do that ....
而且需要15+秒才能加载,但是我想从1-5秒加载该页面...我知道这取决于互联网的连接速度,但是我该怎么做....
You first have to identify the problem, and you've given us no information to do so. 您首先必须确定问题,并且没有给我们提供任何信息。
You could postpone loading database information until after the page is loaded by requesting your data-centric components through Ajax but after adding everything up it'll probably be the same amount of time to fully load your page. 通过Ajax请求以数据为中心的组件,您可以将数据库信息的加载推迟到页面加载之后,但是在将所有内容累加起来之后,完全加载页面的时间可能相同。 Your problem is more along the lines of slow hardware, slow internet connection to/from your server.
您的问题更多是由于硬件速度较慢,与服务器之间的Internet连接速度较慢。 I'm guessing that you're on a shared host, which is probably why you're suffering from slower speeds.
我猜您在共享主机上,这可能就是为什么您速度较慢的原因。
How large are these tables? 这些桌子有多大? How much php script processing are you doing?
您正在执行多少PHP脚本处理? Have you looked at how long the queries take to run, outside of any script?
您是否在任何脚本之外查看了查询运行多长时间?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.