Files
Umbraco-CMS/src/Umbraco.Core/Configuration/Models/ImagingCacheSettings.cs
Ronald Barendse 1a82e0854a v10: Update to ImageSharp v2 (#12185)
* Update to ImageSharp 2.1.0 and ImageSharp.Web 2.0.0-alpha.0.23

* Rename CachedNameLength to CacheHashLength and add CacheFolderDepth setting

* Replace PhysicalFileSystemProvider with WebRootImageProvider

* Support EXIF-orientation in image dimention extractor

* Remove virtual methods on FileProviderImageProvider

* Simplify FileInfoImageResolver

* Update to SixLabors.ImageSharp.Web 2.0.0-alpha.0.25 and remove custom providers

* Make CropWebProcessor EXIF orientation-aware

* Improve width/height sanitization

* Also use 'v' as cache buster value

* Add WebP to supported image file types

* Update to SixLabors.ImageSharp.Web 2.0.0-alpha.0.27 and fix test

* Fix rounding error and add test cases

* Update to newest and stable releases

* Move ImageSharpImageUrlGenerator to Umbraco.Web.Common

* Use IConfigureOptions to configure ImageSharp options

* Implement IEquatable on ImageUrlGenerationOptions classes

* Fix empty/null values in image URL generation and corresponding tests

* Use IsSupportedImageFormat extension method

* Remove unneeded reflection
2022-04-29 13:16:24 +02:00

52 lines
1.8 KiB
C#

// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.ComponentModel;
using System.IO;
namespace Umbraco.Cms.Core.Configuration.Models
{
/// <summary>
/// Typed configuration options for image cache settings.
/// </summary>
public class ImagingCacheSettings
{
internal const string StaticBrowserMaxAge = "7.00:00:00";
internal const string StaticCacheMaxAge = "365.00:00:00";
internal const int StaticCacheHashLength = 12;
internal const int StaticCacheFolderDepth = 8;
internal const string StaticCacheFolder = Constants.SystemDirectories.TempData + "/MediaCache";
/// <summary>
/// Gets or sets a value for the browser image cache maximum age.
/// </summary>
[DefaultValue(StaticBrowserMaxAge)]
public TimeSpan BrowserMaxAge { get; set; } = TimeSpan.Parse(StaticBrowserMaxAge);
/// <summary>
/// Gets or sets a value for the image cache maximum age.
/// </summary>
[DefaultValue(StaticCacheMaxAge)]
public TimeSpan CacheMaxAge { get; set; } = TimeSpan.Parse(StaticCacheMaxAge);
/// <summary>
/// Gets or sets a value for the image cache hash length.
/// </summary>
[DefaultValue(StaticCacheHashLength)]
public uint CacheHashLength { get; set; } = StaticCacheHashLength;
/// <summary>
/// Gets or sets a value for the image cache folder depth.
/// </summary>
[DefaultValue(StaticCacheFolderDepth)]
public uint CacheFolderDepth { get; set; } = StaticCacheFolderDepth;
/// <summary>
/// Gets or sets a value for the image cache folder.
/// </summary>
[DefaultValue(StaticCacheFolder)]
public string CacheFolder { get; set; } = StaticCacheFolder;
}
}