Why is it slow to test ajax locally?

Source: Internet
Author: User
Test ajax locally to receive paging data. The response should be around 1 S (above) but is there any good solution between 900 ms and ms on the server to solve the slow ajax acquisition speed? The paging data has been changed to json. The data size is not much improved. The display time is kb and the processing time is 1.03s. logic... test ajax locally to receive paging data. The response should be around 1 S (above) but is there any good solution between 900 ms and ms on the server to solve the slow ajax acquisition speed? The paging data has been converted into json, which is not much improved.
The data size is displayed in 2.9kb and 1.03 s. The processing logic is that 10 mysql information fields are simply queried.

I tested whether to return a small data of 392b or about 1 S. Is it because my local database query is slow?

Jquery and ajax are used.

Reply content:

Test ajax locally to receive paging data. The response should be around 1 S (above) but is there any good solution between 900 ms and ms on the server to solve the slow ajax acquisition speed? The paging data has been converted into json, which is not much improved.
The data size is displayed in 2.9kb and 1.03 s. The processing logic is that 10 mysql information fields are simply queried.

I tested whether to return a small data of 392b or about 1 S. Is it because my local database query is slow?

Jquery and ajax are used.

This problem is probably because your local supportIPv6And your localMysqlSupport reverse resolution.
There are three solutions to the problem:

  1. Modify local database connectionlocalhostChange127.0.0.1This is the simplest way.

  2. Disable IPv6 in Registry

  3. MySql disables reverse resolution.

Here is a blog can refer to: http://blog.onephp.net/archives/32/

You need to first check where the slowness is. From the data perspective, it seems that the background processing logic is time-consuming. This depends on how the implementation logic is optimized. In addition, we recommend that you use chrome's developer tool to check the response time of each section of the request and then diagnose whether it is related to the network.

@ Lovnie is skillful in asking questions. A simple method is to answer questions by yourself.
Q: Why is the local speed of ajax requests slow and the server speed?
A: The local network is unlikely to be a problem, that is, the background interface is slow! (Check the interface response time for debug debugging)
Q: Where is the interface slow? (Assuming the previous analysis is correct)
A: What is the time-consuming code for analysis with logs?
This problem becomes the reason why the XXX code runs so slowly. You can search for it and analyze it by yourself. The problem cannot be solved, so the problem becomes more advanced.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.