ImageUltimateWebConfiguration Class

Provides properties and methods for changing this library's configuration for web use.

Definition

Namespace: GleamTech.ImageUltimate.AspNet
Assembly: GleamTech.ImageUltimate (in GleamTech.ImageUltimate.dll) Version: 5.8.7
C#
public sealed class ImageUltimateWebConfiguration : ConfigurationBase<ImageUltimateWebConfiguration>
Inheritance
Object    ConfigurationBaseImageUltimateWebConfiguration    ImageUltimateWebConfiguration

Constructors

ImageUltimateWebConfiguration Initializes a new instance of the ImageUltimateWebConfiguration class.

Properties

CacheAutoTrimInterval Gets or sets a value that specifies the interval to run automatic cache trimming (clean up). Cached items older than CacheMaxAge will be removed when the cache is trimmed. If the value is 0 or negative, the auto trim is disabled. The default value is 20 minutes. In string representation, value in format "d" is considered days (e.g. "30" is 30 days) and value in format "hh:mm" is considered hours and minutes (e.g. "1:30" is 1 hour and 30 minutes). Note that "24:00" would mean 24 days as hour range is 0 to 23 and minute range is 0 to 59. See Parse(String) documentation for details on possible string representations.
CacheLocation Gets or sets the location to store cached images. The default value is "~/App_Data/ImageCache".

This property can be set to:

  • A plain string which contains a physical/virtual path
    (e.g. "c:\SomeFolder", "/SomeFolder", "~/SomeFolder").

    This is parsed as PhysicalLocation.

    Note that virtual paths can only be resolved in a web application
    and on Linux paths starting with "/" are physical paths and not virtual paths.

  • A Location instance created with one of the builtin location providers
    (e.g. PhysicalLocation, AzureBlobLocation, AmazonS3Location, ArchiveLocation).

    You can also override Location base class to implement your custom location provider.

  • A provider string which defines a specific location provider
    (e.g. "Type=Physical; Path=c:\SomeFolder").

When you use a cache path within the current application's root directory (e.g. "~/SomeFolder", "/SomeFolder" or "C:\inetpub\wwwroot\MySite\SomeFolder"), the request will be handled directly via IIS (using RewritePath) for better download performance.

CacheMaxAge Gets or sets a value that specifies the maximum amount of time to consider a cached item fresh and keep it stored in the cache. Cached items older than this age will be removed when the cache trimming (clean up) runs (when auto trim is run or when Trim method is manually called). The default value is 90 days. In string representation, value in format "d" is considered days (e.g. "30" is 30 days) and value in format "hh:mm" is considered hours and minutes (e.g. "1:30" is 1 hour and 30 minutes). Note that "24:00" would mean 24 days as hour range is 0 to 23 and minute range is 0 to 59. See Parse(String) documentation for details on possible string representations.
CacheWaitTimeout Gets or sets a value that specifies the maximum amount of time to wait for a cached item to be available (wait for a file lock from other threads or processes to become available, i.e. wait for an ongoing caching of the same file to complete) before giving up on the cache request. The default value is 5 minutes. In string representation, value in format "d" is considered days (e.g. "30" is 30 days) and value in format "hh:mm" is considered hours and minutes (e.g. "1:30" is 1 hour and 30 minutes). Note that "24:00" would mean 24 days as hour range is 0 to 23 and minute range is 0 to 59. See Parse(String) documentation for details on possible string representations.
CurrentGets current global configuration instance.
ImageHandlerPath Gets or sets a value that specifies the application-relative handler path for ImageHandler. The default is "image.ashx".

It is not recommended to change it unless you have a conflict in your web application. This property will be effective only if it is changed before web application starts.

RewritePathEnabled Gets or sets a value that specifies whether RewritePath should be enabled. The default is true. When you use a cache path within the current application's root directory (e.g. "~/SomeFolder", "/SomeFolder" or "C:\inetpub\wwwroot\MySite\SomeFolder"), the request will be handled directly via IIS (using RewritePath) for better download performance. If you set this property to false, then the internal download handler will be forced so that byte-range requests are supported.
SourcePath Gets or sets the default source path for finding images. The default value is "~/App_Data/ImageSource". Value can be a virtual or physical path, however always returns a physical path, ie. if the original value was a virtual path, returns the resolved physical path. Whenever a plain file name (eg. Picture.jpg) or a non-rooted path (eg. SomeFolder/Picture.jpg) is passed to a image loading/processing method, it will be considered relative to this source path. If the path passed to the method is rooted (eg ~/Picture.jpg, /SomeFolder/Picture.jpg or C:\SomeFolder\Picture.jpg), this source path will be ignored for that method call.

Methods

Clear
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
GetCacheGets the image cache used by this web configuration instance.
Load(Boolean)Loads from <appSettings> element of the Web.config or application configuration file.
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Load(FuncString, String, String, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Load(IDictionaryString, String, String, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Load(NameValueCollection, String, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Load(Stream, ConfigurationFileFormat, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Load(String, ConfigurationFileFormat, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Save(Stream, ConfigurationFileFormat, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Save(String, ConfigurationFileFormat, Boolean)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Save(ActionString, String, String, Boolean, ExpressionFuncUTP, Object)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Save(IDictionaryString, String, String, Boolean, ExpressionFuncUTP, Object)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)
Save(NameValueCollection, String, Boolean, ExpressionFuncUTP, Object)
(Inherited from ConfigurationBaseImageUltimateWebConfiguration)

See Also