I have a speed issue with Symfony 1.4 and AJAX.
My routing:
ajax_search:
url: /search.:sf_format
param: { module: article, action: articlesAjaxSearch, sf_format: html }
requirements:
sf_format: (?:html|js)
My js:
jQuery.ajax({
type: 'GET',
url: jQuery('#searchform').attr('action'),
data: form_data,
success: function(result)
{
jQuery("#searchform #searchresult").html(result).slideDown('fast');
}
});
My action:
public function executeArticlesAjaxSearch(sfWebRequest $request) {
$this->getResponse()->setContent("<html><body>Hello, World!</body></html>");
return sfView::NONE;
}
This is a shorter version, but I need to improve speed. The AJAX call need around 200 ms to fetch this HTML content back.
Here's my log:
Sep 05 09:25:58 symfony [info] {articleActions} Call "articleActions->executeArticlesAjaxSearch()"
Sep 05 09:25:58 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
Sep 05 09:25:58 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Sep 05 09:25:58 symfony [info] {sfWebDebugLogger} Configuration 0.88 ms (8)
Sep 05 09:25:58 symfony [info] {sfWebDebugLogger} Factories 53.19 ms (1)
Sep 05 09:25:58 symfony [info] {sfWebDebugLogger} Action "article/articlesAjaxSearch" 115.39 ms (1)
Sep 05 09:25:58 symfony [info] {sfWebDebugLogger} Database (Doctrine) 0.01 ms (3)
Sep 05 09:25:58 symfony [info] {sfWebDebugLogger} View "None" for "article/articlesAjaxSearch" 0.00 ms (1)
Sep 05 09:25:58 symfony [info] {sfWebResponse} Send content (39 o)
I need a solution to improve my ajax request speed for symfony 1
Sep 05 09:25:58 symfony [info] {sfWebDebugLogger} Action "article/articlesAjaxSearch" 115.39 ms (1)
I don’t understand why this take so long. Hope anyone can help me out I searching for more then one day for a solution.
The whole time of the ajax request take ~200ms without implement logic.