Between one of the earlier devs of 2.x, decemeber 10th or so, and the RC1, the ajax page loading got slower. Did anyone else notice this?

There is now a second or so delay before each first tab loads. Since I have multiple tabbed blocks on each page, there is a strange effect as one tab loads on one block, then another block loads, and then another block. In total it takes around 5-6 seconds whereas it used to take only 1 second to immdiately load everything.

Comments

pasqualle’s picture

I could think about only one change that could make this effect. Earlier the first tabpage within ajax quicktabs was loaded at page load, now it is loaded dynamically after the page is loaded.
There was a problem that it seemed like that the first tabpage was special within ajax quicktabs. The ajax views always worked without problem on the first tabpage, but they had problems on the other tabpages. Now the first tabpage is no different than the others..

The page load should be faster now, as the first tabs are loaded after the page is loaded. And the overall time to display the page plus the first tabs should be the same as earlier.. Can you please test the overall time, and confirm or deny my theory?

I would rather fix #341017: provide processing icon for ajax tabs issue, to make it clearly visible that the tabs are still loading, than revert that change..

Flying Drupalist’s picture

Hi, is it possible that loading the first tab separately increases the number of HTTP requests? If the mysql load time is very small, then what's most noticable to me is the request time, which is increased. I'm also sure that closing and reopening connections to the mysql server means a bit hit to the load.

I seen no downside to having the first tab different, other than that it may confuse some people when things work there and don't work on secondary tabs, but ultimately that's a minor issue for the developer but will result in speed improvements for the end user.

I'm not sure if I can test the different loads, but I'm 99% sure the new loading is overall slower, it may be due to the ajax requests, database connections being opened and closed, and I'm definitely not looking forward to having half of my page being covered in loading icons while blocks load one by one.

Thanks.

"I would rather fix #341017: provide processing icon for ajax tabs issue, to make it clearly visible that the tabs are still loading, than revert that change.."

I think it's probably best to do both. Thanks.

Flying Drupalist’s picture

@Pasqualle what do you think about this?

pasqualle’s picture

I think you are right. here is a quick patch

change line 199 in quicktabs.module

// Do not render any tabpgage, it is done from quicktabs.js. 

to

      if (isset($active_tab)) {
        $attributes = drupal_attributes(array(
          'id' => 'quicktabs_tabpage_'. $quicktabs['qtid'] .'_'. $active_tab,
          'class' => 'quicktabs_tabpage',
        ));
        $output .= '<div'. $attributes .'>'. quicktabs_render_tabpage($quicktabs['tabs'][$active_tab]) .'</div>';
      } 

if it is better, then I'll have to fix this properly..

Flying Drupalist’s picture

Thank you very much. Works terrifically.

pasqualle’s picture

Category: support » bug
Status: Active » Fixed

http://drupal.org/cvs?commit=164064

If you will have the time, please test the latest dev release.

Flying Drupalist’s picture

OK, my site is running the dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Flying Drupalist’s picture

Title: Ajax loading got slower » Option to Ajax load the first tab as well
Category: bug » feature
Status: Closed (fixed) » Active

Now I'm in a situation where I have large, non-essential content on first tab, and I would like the first tab to be loaded later (basically taking back what I said a year ago).

I think the best way to handle this would be to add a third radio under Ajax.

"Yes: Load all tabs, including the first, by Ajax."

pheraph’s picture

+1 for the "Yes: Load all tabs, including the first by Ajax". Are there any plans to add this option?

kndr’s picture

+1 for: "Yes: Load all tabs, including the first by Ajax". If I understand this correctly it means, that none of tab should be loaded at the startup and there is no default, active tab. It is very usefull option when content are very heavy and shouldn't be shown at the startup. I am attaching the patch

kndr’s picture

Status: Active » Needs review
netw3rker’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Issue summary: View changes

moving this to 6.x-3.x-dev to see if it has been implemented in the 3.x line. if so will bump it up to 7.x-3.x for a backport to be built for 6.x

avpaderno’s picture

Status: Needs review » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.