UNI Webtools: Resources for Web Developers


Performance Comparison of Major Web Browsers

The latest versions of the five major most web browsers (Mozilla Firefox 3.5, Google Chrome 3.0, Microsoft Internet Explorer 8.0, Opera 10.0, and Apple Safari 4.0) went head to head under six performance indicators: JavaScript speed, average CPU usage under stress, DOM selection, CSS rendering speed, page load time, and browser cache performance. Each web browser was tested three times under an unprimed cache (except for the browser cache performance), and their average value reported in the results.   Results

Universities using Drupal

From Dries Buytaert's blog...

We're on a roll with universities using Drupal! Portland State University (PSU), with more than 24,000 students, is using Drupal for their main website.  Full Post, w/ other university examples...

Drupal Performance Tip: Block Visibility

from Lullabot Articles...

It's not uncommon in more complex themes to have many different block regions, and even dynamic regions that will only appear on certain pages or when viewing nodes of certain types. One very common use-case is to have both a page.tpl.php, and a page-front.tpl.php, each of which print out different regions, particularly for ads or promotions.

Page Layout Diagram

Defining block regions is super easy; simply add a couple lines in your theme's .info file:

regions[ad_top]        = Ad Top
regions[ad_bottom]     = Ad Bottom
regions[front_sidebar] = Front Sidebar
regions[sidebar_ad]    = Sidebar Ad
regions[content]       = Content
regions[feature_a]     = Feature A
regions[feature_b]     = Feature B
regions[feature_c]     = Feature C
regions[feature_d]     = Feature D

And then in your *.tpl.php file, wherever you want the region to appear, simply print out its machine-readable name:

<?php
print $feature_a;
?>

Don't want the blocks in the "Feature A" region to show up in page.tpl.php? No problem! Just don't print the region out there! Done! Right?

For many people, their concern about block visibility ends there; they're not showing up, so they move on with their day. However, this can have a profoundly negative performance impact on your site.

The block_list() function has no knowledge of which block regions are printed out on this page. This means that Drupal's default behaviour is to render every single block on your site that's assigned to any region on every single page view, regardless of whether the region's content is actually being visibly printed out or not.

If you're doing a bunch of complex queries in those feature blocks, and you're not hiding the block by one of the following:

  • Setting the block's visibility settings (on the block's configuration form) to not show up on pages that do not have the region it's assigned to printed. For example, setting any blocks assigned to the Feature A region to only show up on the <front> page.
  • Hiding the visibility of the block by some other means; for example, by limiting it to a role using the checkboxes on the block configuration form (or content types in Drupal 7), or installing a contributed module that implements hook_db_rewrite_sql() on the block list.

...then your server is probably melting. :P

Incidentally, setting <front> visibility by hand in each block that should only appear on the front page can be fairly tedious. You might also have a look at the Block Page Visibility module, which allows you to hijack the block visibility settings. It'll prevent them from being set anymore in the UI, but will allow you to establish whatever complex visibility logic you need in code instead.

So remember: don't rely on regions and template files to hide blocks; they do so visually only. Using block visibility settings will ensure that extra processing is not performed on blocks that aren't being printed out in the first place, and keep your server nice and speedy!

Understanding Users of Social Networks

If the ongoing social networking revolution has you scratching your head and asking, "Why do people spend time on this?" and "How can my company benefit from the social network revolution?" you've got a lot in common with Harvard Business School professor Mikolaj Jan Piskorski.

Only difference: Piskorski has spent years studying users of online social networks (SN) and has developed surprising findings about the needs that they fulfill, how men and women use these services differently, and how Twitter—the newest kid on the block—is sharply different from forerunners such as Facebook and MySpace.  Source: Working Knowledge

Do it with Drupal

If you have the opportunity and funding to go to off-campus Drupal training, the Lullabot "Do it With Drupal" conference is excellent.

Do It With Drupal 2009 will be held December 9th, 10th, and 11th at the New Orleans Marriot at the edge of French Quarter in New Orleans, Louisiana. Registrations open on Monday at 12:00pm Eastern and the first 25 registrations will get a special deal.

Find out more information about Do It With Drupal 2009 at DoItWithDrupal.com. And if you'd like to get a taste of last year's event, you can still purchase access to the 2008 video archive, 34 sessions and over 40 hours of Drupal and site-building videos, right at your fingertips.