CakePHP, MySQL query taking time which locks my UI
I have a peculiar problem which has arisen in my application off late . In one of the pages , a sql query is taking too much time to load , and it is causing my UI to get locked . What开发者_开发知识库 happens is untill and unless that query gets completed in the backend, I can't see anything in the browser .
Also , if I open a new tab and hit the same url there, my browser won't show anything and will wait till my query finishes.
In the present scenario, I can't change the query immidiately , it needs time to optimize it, but till then I need some time-out settings wither in the mysql db or in cakephp, where in my UI won't wait for the query to finish.
How to do that?
don't execute the query on page request. Put an ajax call in your page and call another action that execute the query and return the result.
精彩评论