We've been testing using ajax to load various pages, using a process like this:
1. user loads any page
2. user clicks to another page
3. click is handled by javascript and turned into a POST, adding a flag to the POST data telling miva that this is an ajax request
4. miva receives the POST, and returns only necessary content, for example:
5. javascript receives the return data and inserts it into the current page, erasing whatever was in that spot previously
This all works fine, and the pages do load faster.
Today I used the debug tool and mvprof to profile a few page loads. I noticed that the ajax requests are still loading the category tree, even though that part is excluded on ajax loads:
I'm guessing this is because miva loads all the included items before running through the template code. I suppose this means the best way to further speed up page loads is to have entirely separate versions of pages loaded by ajax, that don't include any unnecessary items.
If anyone has any other insight I'd appreciate it, maybe I missed something and there's a better way to go about this?
1. user loads any page
2. user clicks to another page
3. click is handled by javascript and turned into a POST, adding a flag to the POST data telling miva that this is an ajax request
4. miva receives the POST, and returns only necessary content, for example:
Code:
<mvt:if expr="ISNULL g.ajaxRequest"> <!-- this will only be loaded if the ajax flag is off --> <!-- therefore, ajax loads won't get the html_profile, which is fine because they don't need it --> <mvt:item name="html_profile" /> </mvt:if> .... other content that is always loaded
This all works fine, and the pages do load faster.
Today I used the debug tool and mvprof to profile a few page loads. I noticed that the ajax requests are still loading the category tree, even though that part is excluded on ajax loads:
Code:
<mvt:if expr="ISNULL g.ajaxRequest"> <mvt:item name="category_tree" /> </mvt:if>
If anyone has any other insight I'd appreciate it, maybe I missed something and there's a better way to go about this?
Comment