Enabling Access to Static Image Renditions in DAM
By Kyle Hatlestad on Nov 02, 2009
Whenever you go to the Renditions page for an image that was converted using the Digital Asset Management conversion from the Inbound Refinery, you have the chance to download those particular images by clicking on the rendition name.If you hover your mouse over one of those links, you'll notice the URL is pointing to a dynamic service call in UCM which calls the GET_FILE service and defines the rendition to get (e.g. http://server/idc/idcplg?IdcService=GET_FILE&dDocName=ECM5_001407&dID=2754&RevisionSelectionMethod=specific&Rendition=Preview&allowInterrupt=1).
What's happening under the hood in regards to the storage of those renditions is a bit different then with other content items. While the Web and Thumbnail images are stored within the weblayout structure normally, those extra renditions are actually stored together in a .zip file. If you look within the weblayout directory, they are stored with the naming convention of "<content id>@z~<revision>.zip". So when you click on the link for that rendition, the server is actually extracting that particular file out of the zip before sending it out. On an infrequent image-by-image basis, that process works fine. But if try and serve these images on a more frequent basis, that can begin to put a strain on the system to deliver those files.
But there is a way to allow those images to also be available statically so that the server doesn't have to extract them with each request. The current ZipRenditionManagement component (version 2009_05_04 (Build 45)) now has the ability to place particular image rendition files in their own sub directories for static delivery. There are four methods offered to create and access those renditions.
- You can set the configuration variable 'RenditionListExportedForStaticAccess' which would identify the list of renditions to offer statically. This is a pipe delimited list which also supports wildcards.
Now when images are checked in, that static version will immediately become available in the weblayout structure.
- You can call the service CREATE_STATIC_RENDITION and pass it the dDocName (Content ID) and Rendition name .
- The Idoc Script function docGetRenditionPath(rendition [, dDocName]) will return the static URL to the image if it is available (such as having been created on check-in using the first method). If not, it will return the GET_FILE URL instead. If you have the dDocName available as part of a DOC_INFO resultset, you don't need to specify it.
- The Idoc Script function docCreateRenditionPath(rendition [, dDocName]) which works like the previous function. But if the static rendition has not already been created, this will create it at that moment and return the static URL. So this will always guarantee a static URL.
For more information on these instructions, be sure to look at the readme.txt (and not readme.html) file contained within the ZipRenditionManagement component.
Given this capability, the next logical question is if these static renditions are available through Site Studio. From an access perspective, absolutely. These static renditions are part of the weblayout path and are accessible like any other image or checked in asset. So if you had a dynamic list of images, you could use the above methods to point to those particular renditions.
But as far as selecting a particular image rendition in the Contribution Editor, that is still coming. Right now in the latest DigitalAssetManager component, it will display Select buttons next to each rendition on the Renditions page. But they currently only point to the Web rendition URL. This is currently being looked into and hopefully resolved in the next Site Studio patch.