Local test AJAX receive paging data to reflect about 1s (above) but on the server on the 100ms to more than 900 Ms What is the best way to solve the Ajax acquisition speed is slow? There's not much improvement in converting paging data to JSON.
Data size display is 2.9KB time consuming 1.03s processing logic is simply query the MySQL 10 information field also 3
Did you test it again to return a small 392b of data or to return around 1s should be my local database query slow problem?
With jquery and Ajax.
Reply content:
Local test AJAX receive paging data to reflect about 1s (above) but on the server on the 100ms to more than 900 Ms What is the best way to solve the Ajax acquisition speed is slow? There's not much improvement in converting paging data to JSON.
Data size display is 2.9KB time consuming 1.03s processing logic is simply query the MySQL 10 information field also 3
Did you test it again to return a small 392b of data or to return around 1s should be my local database query slow problem?
With jquery and Ajax.
The problem is likely to be your local support IPv6
, and your local support for Mysql
reverse parsing is a curse.
There are three ways to solve the problem:
Modifying the local connection database localhost
instead 127.0.0.1
, this is the simplest approach.
Registry Disable IPV6
MySQL disables reverse parsing.
Here is a blog can refer to: http://blog.onephp.net/archives/32/
Need to look at the slow in the first place. From the data, it seems that the background processing logic takes a long time, this depends on the implementation of the logic tuning. It is also recommended to use Chrome's developer tools to see the response time of the request sections, and then to diagnose whether it is related to the network.
@lovnie Ask a question is a skill, a simple way is to ask yourself to answer.
Q: Ajax requests local slow, server fast, where is the cause?
A: The local is not likely to be a network problem, that is the background interface slow! (then debug debug to see the interface response time.)
Q: Where is the interface slow? (assuming that the previous analysis was right)
A: Add logs to analyze where the time-consuming code is
Then the problem becomes the XXX code running why so slow, and then search for a, their own analysis, can not solve the question again, so the problem seems more advanced