![]() |
two ajax calls are slow! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: two ajax calls are slow! (/showthread.php?tid=44132) |
two ajax calls are slow! - El Forum - 08-04-2011 [eluser]keepyourweb[/eluser] In my app I have two ASYNC ajax calls (jQuery) that I control with Deferred method ( $.when(...).then(...) ); They call a function on my controller that prints a small json, but they are slow; If I remove one of these is fast, why? The problem is only with CodeIgniter, if the ajax calls referencing a external php file (no controller function) is fast. PS: The fault is not the controller's functions , because do an echo of a handwritten json. PPS: The ajax calls are on an external java file. Thank. two ajax calls are slow! - El Forum - 08-05-2011 [eluser]n0xie[/eluser] What does firebug tell you? two ajax calls are slow! - El Forum - 08-05-2011 [eluser]keepyourweb[/eluser] nothing, what should he tell? two ajax calls are slow! - El Forum - 08-05-2011 [eluser]n0xie[/eluser] Well it should give a considerable slow response in your NET tab. You might want to investigate what exactly gets sent and what the response is. It might give you a clue what is slowing down your request. two ajax calls are slow! - El Forum - 08-05-2011 [eluser]keepyourweb[/eluser] He does not tell me anything special. But there is a large time differences, the first call 280ms and the second 1.26s! Even if I reverse. two ajax calls are slow! - El Forum - 08-05-2011 [eluser]n0xie[/eluser] That is weird. I'm pretty much clueless to where this behaviour comes from ![]() two ajax calls are slow! - El Forum - 08-05-2011 [eluser]keepyourweb[/eluser] Maybe there are sessions that are blocking the calls, I do not know. two ajax calls are slow! - El Forum - 08-05-2011 [eluser]John Murowaniecki[/eluser] I work a lot with ajax and CI, eventually I get some slow behavior but normally all request/posts are fast (very fast).. But I´ve decided to test, so there´s my controller: Code: class ajax extends Controller Code: var extc = 0; So when I execute the func_run() on the firebug I get a nice result despite I´ve sending almost nothing (and receiving almost nothing). I'm treating this as the "end" of the request the termination of the function (and not the actual return ajax). Did you check your error log? two ajax calls are slow! - El Forum - 08-05-2011 [eluser]keepyourweb[/eluser] Thank you for your interest! I don't know why, but now is fast, normal! Tomorrow I try again, it is very strange. two ajax calls are slow! - El Forum - 08-06-2011 [eluser]nikes[/eluser] Don't understand. |