Index: branches/release-33/lib/MT/CMS/Blog.pm
===================================================================
--- branches/release-33/lib/MT/CMS/Blog.pm (revision 1776)
+++ branches/release-33/lib/MT/CMS/Blog.pm (revision 1778)
@@ -531,4 +531,5 @@
         }
     }
+    $app->run_callbacks('post_build');
     $app->call_return;
 }
@@ -541,5 +542,15 @@
     require MT::Blog;
     my $q             = $app->param;
-    my $blog_id       = $q->param('blog_id');
+    my $start_time    = $q->param('start_time');
+
+    if ( ! $start_time ) {
+        # start of build; invoke callback
+        $app->run_callbacks('pre_build');
+        $start_time = time;
+    }
+
+    my $blog_id       = int($q->param('blog_id'));
+    return $app->errtrans("Invalid request.") unless $blog_id;
+
     my $blog          = MT::Blog->load($blog_id);
     my $order         = $q->param('type');
@@ -550,4 +561,5 @@
     my $archiver      = $app->publisher->archiver($type);
     my $archive_label = $archiver ? $archiver->archive_label : '';
+
     $archive_label = $app->translate($type) unless $archive_label;
     $archive_label = $archive_label->() if ( ref $archive_label ) eq 'CODE';
@@ -556,8 +568,4 @@
     my $offset = 0;
     my ($total) = $q->param('total');
-
-    ## Tells MT::_rebuild_entry_archive_type to cache loaded templates so
-    ## that each template is only loaded once.
-    $app->{cache_templates} = 1;
 
     my ($tmpl_saved);
@@ -774,4 +782,5 @@
             offset          => $offset,
             complete        => $complete,
+            start_time      => $start_time,
             incomplete      => 100 - $complete,
             entry_id        => scalar $q->param('entry_id'),
@@ -783,4 +792,5 @@
     }
     else {
+        $app->run_callbacks( 'post_build' );
         if ( $q->param('entry_id') ) {
             require MT::Entry;
@@ -809,9 +819,11 @@
             }
             my %param = (
-                all          => $all,
-                type         => $archive_label,
-                is_one_index => $is_one_index,
-                is_entry     => $is_entry,
-                archives     => $type ne 'index',
+                all             => $all,
+                type            => $archive_label,
+                is_one_index    => $is_one_index,
+                is_entry        => $is_entry,
+                archives        => $type ne 'index',
+                start_timestamp => MT::Util::epoch2ts($blog, $start_time),
+                total_time      => time - $start_time,
             );
             if ($is_one_index) {
@@ -838,5 +850,4 @@
             }
             else {    # popup--just go to cnfrmn. page
-                $app->run_callbacks( 'rebuild', $blog );
                 return $app->load_tmpl( 'popup/rebuilt.tmpl', \%param );
             }
@@ -854,4 +865,12 @@
     my $app           = shift;
     my $q             = $app->param;
+    my $start_time    = $q->param('start_time');
+
+    if ( ! $start_time ) {
+        # start of build; invoke callback
+        $app->run_callbacks('pre_build');
+        $start_time = time;
+    }
+
     my $type          = $q->param('type');
     my $next          = $q->param('next') || 0;
@@ -906,4 +925,5 @@
         build_next      => $next,
         total           => $total,
+        start_time      => $start_time,
         complete        => 0,
         incomplete      => 100,
Index: branches/release-33/lib/MT/CMS/Entry.pm
===================================================================
--- branches/release-33/lib/MT/CMS/Entry.pm (revision 1746)
+++ branches/release-33/lib/MT/CMS/Entry.pm (revision 1778)
@@ -1388,4 +1388,5 @@
             my $res = MT::Util::start_background_task(
                 sub {
+                    $app->run_callbacks('pre_build');
                     $app->rebuild_entry(
                         Entry             => $obj,
@@ -1398,4 +1399,5 @@
                     ) or return $app->publish_error();
                     $app->run_callbacks( 'rebuild', $blog );
+                    $app->run_callbacks( 'post_build' );
                     1;
                 }
