Versions Compared

Key

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

...

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

...

Field

Description

SiloId

This is the Id of the silo that has the asset requested.

AssetId

Is the Id of the asset that is requested.

Quality

Overrides the quality specified in the Sitecore field.

Quality supports both 'by name' and 'by id'

Resize

Only applies to image assets.

One of the concepts and principles when using a DAM system is to use specific qualities for every use. If images are needed in different sizes, it should be configured in Digizuite™ DAM.

However, there is a resize feature.

Width How wide the image will be in pixels.

Height How high the image will be in pixels.

By default a resize does not keep aspect ratio, but you can set an option to keep aspect ratio.

Compress

*

Only applies to image assets.

Indicates whether the asset should be saved using a worse quality, thereby reducing the physical size. 

from 0-100 is allowed, where 0 is the worst quality, but least physical storage.

Options

*

Options is a dash ("-") separate list and can contain these options:

download - Will download the asset requested.

keepaspectratio - Will enforce aspect ratio on from the original asset, if a resize is requested.

upscaleallowed - Will allow upscaling an image. The default is to disallow that.

*Optional

Understanding the DigizuiteMediaCache

The DigizuiteMediaCache is where everything, except videos, is saved. The cache location is configurable and is located in DFS.Settings.config

...

The extension is retrieved from the file saved in the cache. The naming scheme enable unique names and hence the extension can be extracted from the file in the cache. Originally, the file is saved with the correct extension based on what is served from the Digizuite.

UNC path

The dfsmedia pipeline also supports having a centralized cache, which means multiple servers can have the same cache. This decreases storage, but also performance, because files are then cached on a UNC which is slower than having it locally. This is something each client has to have an opinion on.

Implementation

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

...

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

If the new "dfsmedia" pipeline is used, it is possible to use another prefix for the media URL. An example could be that one wanted the company name instead of dfsmedia as the media URL prefix. This can be done doing the following:

...

Doing this ensures the following URL scheme: http(s)://<sitecore url>/<new prefix>/29a605d46a3340418c16542f7272c3ec/110-50035

Manually deleting cache entries

The cache is invalidating if the image in Digizuite is re-transcoded. The cache invalidation results in all the entries for the given asset, being deleted. If one wishes to manually clear the cache this is also an option. There are two ways in which this can be accomplished:

...