The Time Machine allows you to browse snapshots of how a site has looked historically, or to view how a site will look in the future based on scheduled content publishing and expiration dates.
- Static Snapshots
- Identifying Time Machine Access with the User Agent Request Header
- Video: dotCMS Time Machine
You can use the Time Machine to take a snapshot, or static copy, of selected hosts and save it as a bundle. The bundle contains static versions of all pages and content on the site, so once you have saved a snapshot, the Time Machine bundle can then be used to run a static copy of your sites on a web server other than dotCMS. Multiple snapshots can be taken for each given host.
Please see the Time Machine Snapshots documentation for more information on how to schedule static snapshots of a site(s).
Identifying Time Machine Access with the User Agent Request Header
When the Time Machine is accessing your page, it will set the
User-agent header in the request to
DOTCMS-TIMEMACHINE. This means that if you with your pages to behave in a specific way (such as serving specific content) when the Time Machine queries and reads your page, you can check the
User-agent request header using Velocity code, and set the behavior and content appropriately.
The following code segment demonstrates how to access the
User-Agent header from your Velocity code:
#if ($request.getHeader("User-Agent") == "DOTCMS-TIMEMACHINE") ##Behavior when Time Machine is accessing the page... #else ##Normal behavior (when users access the page from a browser)... #end
User-agent request header can also be used to determine what type of browser and platform a user is running when accessing your site, to serve up different versions of your site for different platforms. However dotCMS provides a more powerful and simple solution; for more information, please see the User Agent Viewtool documentation.
Video: dotCMS Time Machine
The following video explains how to view historic and future snapshots, and how to set up an Apache server to serve a previously saved snapshot of a website.