Static and Dynamic Publishing Modes
Movable Type supports two modes of page rendering: static and dynamic publishing. The difference between the two modes is mainly the timing of page compilation. Which you choose depends solely on your blog’s particular traffic patterns and size.
Static Publishing: Scaling for High-Volume Sites
Under static publishing, files are updated on the file system (or created when necessary) immediately upon any change in their content. By default, the system is configured to render all pages statically because this mode is universally compatible with all systems.
The static page publishing model provides a number of important advantages. Static pages are significantly more scalable and less resource intensive, once created. This model offers a great deal of flexibility when working with standard webserver-based dynamic page generation technologies (e.g. PHP or server-side includes) and also allow you to easily publish content to multiple or remote locations with standard synchronization tools.
Dynamic Publishing: Immediacy for Blog Users
The dynamic publishing model, which is implemented on top of PHP and the Smarty Template Engine, provides the advantage of immediacy to Movable Type users (as opposed to blog readers). Under dynamic publishing, template and content changes are simply stored in the database and then, when an incoming request for the virtual page is received by the webserver, they are merged on-the-fly and delivered. These compiled requests are additionally cached in the file system to lower the cost of handling subsequent requests.
Under dynamic publishing, rebuild times are shorter and template changes are immediately reflected in the layout since pages are generated when requested. Disk space requirements are reduced since content pages are generated in memory rather than stored on the file system. The system can be configured to publish all of your archives dynamically or, if you prefer, on a template-by-template basis. The ability to employ a custom combination of publishing modes allows you to optimize weblog response performance and server loads.
With the flexibility to choose your publishing model, you can maintain the best balance of fast rebuilds and low server load to suit your needs. Which is best and most efficient depends on your individual situation.
Publishing: Static File Creation
Movable Type handles publishing static files automatically for most actions in which an item (e.g. entry, comment, TrackBack, etc.) is created, deleted or edited. However, there are some actions for the task of publishing is left up to you. Typically, these are procedures that might require multiple steps like the configuration of a weblog or editing of a set of templates. In these cases, it would be wasteful of both time and server resources to publish the weblog upon pressing each Save button.
Publishing your blog dynamically
Although pages which are dynamically published do not require rebuilding, weblogs which employ dynamic publishing still do because they must publish two static trigger files and update their internal cache of virtual URLs.
Therefore dynamic weblogs require a full rebuild on the following occasions:
- When a weblog is first created/published
- For the dynamic publishing subsystem to work, the system must statically publish two files
.htaccess
andmtview.php
. Hence rebuilding is necessary to publishing these files - When the publishing settings for a weblog change, the system must recalibrate itself to respond correctly, whether that is to a new URL structure or to a different dynamic/static template mix. During a rebuild, the system’s FileInfo table is rebuilt which maps virtual URLs to Movable Type content.
You are always be prompted to perform a rebuild by the system when needed and a full dynamic rebuild takes on a small fraction of the time that a full static rebuild does.
Note: In Movable Type 3.x and prior
mtview.php
is published by one of the blog’s templates named Dynamic Site Bootstrap template. This file must be statically published, otherwise, the dynamic publishing system will not be triggered by incoming requests. In Movable Type 4.x and greater the need for the ‘mtview.php` template has been removed and the Dynamic Site Bootstramp template does not exist.
Richard Benson on August 16, 2007, 7:20 a.m. Reply
The mtview.php template is built into MT4 so the Dynamic Site Bootstrap template is deprecated.
Maarten Schenk on September 24, 2007, 8:42 a.m. Reply
If you are experiencing blank screens when visiting dynamically published pages, try checking the ownership of the php folder and the files in it. In some cases, PHP refuses to load libraries that are not owned by the same user that is running the script, due to security reasons it seems. This happens when mt-view.php is not owned by the same user as the files in the php folder. A simple chown -r apache:apache php/ can do wonders in such case.