Move default ImageSharp cache folder to TEMP and map configured value to content root
This commit is contained in:
@@ -12,10 +12,10 @@ namespace Umbraco.Cms.Core.Configuration.Models
|
||||
/// </summary>
|
||||
public class ImagingCacheSettings
|
||||
{
|
||||
internal const string StaticBrowserMaxAge = "7.00:00:00"; // TimeSpan.FromDays(7);
|
||||
internal const string StaticCacheMaxAge = "365.00:00:00"; // TimeSpan.FromDays(365);
|
||||
internal const string StaticBrowserMaxAge = "7.00:00:00";
|
||||
internal const string StaticCacheMaxAge = "365.00:00:00";
|
||||
internal const int StaticCachedNameLength = 8;
|
||||
internal const string StaticCacheFolder = "../umbraco/mediacache";
|
||||
internal const string StaticCacheFolder = Constants.SystemDirectories.TempData + "/MediaCache";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value for the browser image cache maximum age.
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Umbraco.Extensions
|
||||
return Task.CompletedTask;
|
||||
};
|
||||
})
|
||||
.Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = imagingSettings.Cache.CacheFolder)
|
||||
.Configure<PhysicalFileSystemCacheOptions>(options => options.CacheFolder = builder.BuilderHostingEnvironment.MapPathContentRoot(imagingSettings.Cache.CacheFolder))
|
||||
// We need to add CropWebProcessor before ResizeWebProcessor (until https://github.com/SixLabors/ImageSharp.Web/issues/182 is fixed)
|
||||
.RemoveProcessor<ResizeWebProcessor>()
|
||||
.AddProcessor<CropWebProcessor>()
|
||||
|
||||
Reference in New Issue
Block a user