Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

All files from Digizuite are served using the media pipelines. From DFS 9.0.0 the media pipeline has been redesigned, however, the old is still there for compatibility reasons. 

It is configurable which one is used and this is controlled by a config parameter in DFS.Settings.config:

Code Block
titleDFS.Settings.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <settings>
		<setting name="DFS.MediaPipeline" value="dfsmedia"/>
	</settings>
  </sitecore>
</configuration>

There are two options

  • dfsmedia - the new implementation
  • media - the old implementation

The default value is dfsmedia.

This section describes the new dfsmedia pipeline and its capabilities.

Understanding the request

The new dfsmedia pipeline is accessible on the following endpoint: http(s)://<sitecore>/dfsmedia

...

The new dfsmedia pipeline is implemented as a httphandler, using a pipeline in Sitecore. This pipeline is located in the DFS.ServicesPipelines.config file:

Code Block
titleDFS.Settings.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
	<pipelines>     
	 <DFS.Services.DFSMedia>      
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.CheckSecuritySynchronizeAsset, DFS.Client.Services" />        role:require="Standalone or ContentManagement" />
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.GetMediaFromCacheLoadAssetEntity, DFS.Client.Services" />        
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.GetMediaPrerequisitesGetMediaFromCache, DFS.Client.Services" />
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.GetMediaFromDigizuite, DFS.Client.Services" />
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.ResizeImage, DFS.Client.Services" />
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.SaveToCache, DFS.Client.Services" />
        <processor type="DFS.Client.Services.Pipelines.DFSMedia.ResolveFilename, DFS.Client.Services" />
      </DFS.Services.DFSMedia>
    </pipelines>
  </sitecore>
</configuration>

Each step is explained as follows:

CheckSecurity
Pipeline nameDescription
DFS.Client.Services.Pipelines.DFSMedia.SynchronizeAssetThis is only running in role:require="Standalone or ContentManagement". Will sync the asset into the asset silo if it does not exist.
DFS.Client.Services.Pipelines.DFSMedia.LoadAssetEntity

This pipeline looks up the asset in the index using the context user.

If the user does not have access, the asset is not returned and the pipeline is stopped.

DFSDFS.Client.Services.Pipelines.DFSMedia.GetMediaFromCacheThis pipelines constructs a unique name based on the request and checks if the requested asset exists in the cache.
DFS.Client.Services.Pipelines.DFSMedia.GetMediaPrerequisites

If the asset is not cached, it needs to be requested from Digizuite.

This pipeline gets all the prerequisites for requiring the asset in Digizuite

DFS.Client.Services.Pipelines.DFSMedia.GetMediaFromDigizuiteThis pipeline executes the request towards Digizuite
DFS.Client.Services.Pipelines.DFSMedia.ResizeImageIf a resize or #compres?? is requested, the bytes are processed here
DFS.Client.Services.Pipelines.DFSMedia.SaveToCache

This pipeline saves the asset to the cache

DFS.Client.Services.Pipelines.DFSMedia.ResolveFilenameSet the donwload filename header, if a download is requested.

This pipeline may be modified according to customer needs. 

Info
titleHint

Commenting out the security part of the pipeline increases performance of the cost of security, but for content delivery servers for public websites, this is typically not important and therefore it may be beneficial to comment out this step. 

Extending the pipeline

If the pipeline is to be extended, for instance if some custom processing needs to be done to the image, then this may be done in between any of the steps above.

...

ParametertypeDescription
ResultPathstringPath to the directory in which the asset is cached
FileNamestringName of the cached asset
CachedboolBoolean to indicate whether the asset is cached
ResultStreamTask<Stream>Handle for the result stream used to get the asset from Digizuite
ResizeBytesbyte[]If the image is resized and/or compressed, this array contains the result bytes
DownloadUrlstringRedirect URL for download requests
StopPipelineboolIf the pipeline should be aborted, for instance due to security violation, then this is true
AssetAssetIndexableAsset model from the index
StatusCodeHttpStatusCodeStatus code used to indicate the request status.

Changing the URL

...

.

...

  1. Change setting: DFS.MediaPipeline to new prefix (e.g. company name) in config file DFS.Settings.config
  2. Change path in httphandler section in web.config (See DFS 11.0 - 3 Setting up Sitecore section 3.1) to be the new prefix
  3. Change trigger in customHandlers section in DFS.Services.config to be the new prefix
  4. Resynchronize the silo

...

Manually deleting cache entries

...