Fixing the CacheBusting on GetCropUrl as it was totally random which meant the server cache was creating a new cache file for every request. Now changed it to use item updateDate.ToFileTimeUtc as the cache busting value so it will change only when the item is updated in Umbraco.

This commit is contained in:
Jeavon Leopold
2014-03-24 19:27:00 +00:00
parent b450299d45
commit ff2ee540e2
3 changed files with 18 additions and 14 deletions

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Web.Models
public IEnumerable<ImageCropData> Crops { get; set; }
public string GetCropUrl(string alias, bool useCropDimensions = true, bool useFocalPoint = false, bool cacheBuster = true)
public string GetCropUrl(string alias, bool useCropDimensions = true, bool useFocalPoint = false, string cacheBusterValue = null)
{
var crop = Crops.GetCrop(alias);
@@ -58,9 +58,9 @@ namespace Umbraco.Web.Models
sb.Append("&height=").Append(crop.Height);
}
if (cacheBuster)
if (cacheBusterValue != null)
{
sb.Append("&rnd=").Append(DateTime.Now.Ticks);
sb.Append("&rnd=").Append(cacheBusterValue);
}
return sb.ToString();