Seadragon

Creating Content: Deployment

Deep Zoom Images and Deep Zoom Collections are accessed using standard client-side http protocols and a file store for the XML and image files. The generated image tile pyramids can create a lot of data and corresponding folders. Even though the tile pyramids only take up a small amount of extra disk space, a collection of 600 6-megapixel images will still generate over 140,000 files in more than 14,000 subdirectories. Moving such a large number of files can be challenging, but there are a number of techniques that can simplify deploying to a web server.

Generate in Place

The easiest way to deploy your DZI and DZC is by generating your image tile pyramid directly on the production server. This saves the effort of transferring content to a hosted location, though it is best suited for well-established production environments.

A more typical implementation involves staging and deploying the source images, or a manifest linking to them, and then running a production server process to create the DZI or DZC in place. Another option is to run the content creation process on a local machine and save directly to the target deployment server.

This technique is not appropriate in cases where it is not feasible to run the content creation process on the production server, when it’s required to pre-stage content for test or verification prior to deployment, or when significant replication beyond the origin server is required.

Content Reduction

The next approach in simplifying deployment is to reduce the number of actual files. For collections, the tip of each individual DZI is a duplicate of its parent DZC. In circumstances where the images are always accessed as elements within a collection, these redundant files and directories can be removed. Especially for collections that use low resolution images, this can eliminate up to nine files and nine directories for each item in the collection, resulting in significant disk space savings.

Various Deep Zoom content creation tools provide flexibility in setting the dimensions for image tiles. Using a larger image tile size can reduce the number of files required, though depending on the content type, this may create an undesirable increase in tile load latency. For efficiently compressed images, larger tile sizes can significantly reduce the number of individual files and directories required.

Generate to ZIP

A custom work flow can generate DZI and DZC content directly to a ZIP file, which even with the process on the production server to unpack the ZIP file, reduces the overhead of deploying a large number of individual image files.

Smooth Streaming

Deep Zoom Images and Deep Zoom Collections support the Smooth Streaming feature in Silverlight. DeepZoomTools.dll provides the option to render to the Smooth Streaming format, reducing the number of individual files that make up each Deep Zoom Image or Deep Zoom Collection. Each subdirectory in a DZC or DZI is rendered as a single file rather than a directory of multiple files, so the total number of files to be deployed to a production server can be reduced by multiple orders of magnitude.

The deployment server must support Microsoft IIS7 to enable Smooth Streaming.

Updating a Collection

A Deep Zoom Collection should not be updated in place. If any users are currently viewing the collection, their current collection navigation is based on information from the collection XML file, cached locally by the application. Changing the collection contents will invalidate this cached information, most likely causing the user to experience inconsistent and undesirable results.

To correctly update a Deep Zoom collection, create an entirely new collection, deployed at a different URL. The web page hosting the collection can then be updated to reference the new collection URL. Users currently accessing the web page will continue to be served by the old version. New requests to the web page will receive Deep Zoom content from the new URL.

As long as there are no changes to individual Deep Zoom Images within a collection, only the Deep Zoom Collection needs to be updated. New Deep Zoom Image files can even be deployed or deleted, but only the Deep Zoom Collection needs to be updated. As long as existing Deep Zoom images aren’t modified, they do not have to be deployed again. This can be dramatically more efficient than recreating and redeploying all of the individual Deep Zoom Images.

If you are ONLY adding new Deep Zoom images to a Deep Zoom collection, not removing or changing any images, or making any changes to the order of the within the collection, you can simply overwrite the old collection with the new one. As long as the Deep Zoom Collection (DZC) XML file is the last file updated, this in-place update will be transparent. Existing users will continue to access the previous set of images; newly added images will not interfere. When the collection is reloaded, then the new images will be available.

Caching a Collection

A Seadragon collection can be treated as entirely static content by the deployment web server. To maximize efficient access to this content, it’s important to set cache to never expire. This will significantly reduce repeat content access requests from clients, improving performance while reducing both server load and bandwidth costs. Enable one-time HTTP compression on your web server for any XML file types used for Deep Zoom, including .XML, .DZC, .DZI and .CXML.

Copying files

When there is no choice but to copy the individual files to a deployment server over a network connection, there are a few techniques that streamline this process.

Windows includes ROBOCOPY, a command line file copy utility, that is the recommended tool for copying large numbers of files and directories locally or across network connections. ROBOCOPY takes full advantage of all system and network resources for multiple copy threads, and has great options to mirror entire directory structures and intelligently restart a previously interrupted copy without the need to retransfer unchanged files.

If both the source and destination computers are running Windows Vista, Windows 7 (SP1 or later), Windows Server 2008 or Windows Server 2008 R2, full SMB2 support is available. In this environment, the built in file copy features in the Windows Explorer are also very efficient that was the case with previous versions of Windows or when copying in a heterogeneous operating system environment. While ROBOCOPY is still the preferred too, this can be handy for quickly copying smaller Deep Zoom images or collections.

Performance may also be significantly improved by temporarily disabling anti-virus software, eliminating unnecessary processing of the individual files being copied.

Similar to generating content to a ZIP file discussed earlier, another option for deploying an existing Deep Zoom Collection is to compress the directory structure to one or more ZIP files, copy the ZIP files to the server, and then unpack the ZIP files on the server back into the original directory structure. Depending on the deployment server environment and network and computer performance, the end-to-end time for this work flow may be more efficient than copying all the content as individual files and directories.