Umbraco 12 MediaUrl
p
Hi, anyone know how the "v" parameter of the media url is calculated? It looks like it is changed after each deploy even though its the same image. We use azure app services with a clean slot for each deploy.
t
What context is this v parameter in?
p
/media/rmyfhh2u/8883048_webb-hr.jpg?width=767&height=575&v=1d91f600b1b4bc0&quality=80&mode=pad 767w, /media/rmyfhh2u/8883048_webb-hr.jpg?width=1920&height=1080&*v=1d91f600b1b4bc0*&quality=80&mode=pad 1920w
s
Under normal circumstances if you get call the GetCropUrl on an IpublishedContent(it being the media item), then the cacheBusterValue should be this
Copy code
var cacheBusterValue =
            cacheBuster ? mediaItem.UpdateDate.ToFileTimeUtc().ToString("x", CultureInfo.InvariantCulture) : null;
Which means that as long as you don't update the mediaItem it should stay the same.
And/Or show me the razor code on how you get the cropUrl?
p
something like this Model.Block.SplasherImage.GetCropUrl(767,575)
Thanks
@Sven Geusens I was able to resolve this, it wasnt v that changed, it was something else that made the assets not being cached correctly.
s
Glad you got it figured out!
2 Views