2

I am working on a project with sitecore 9.2 and JSS. I installed Dianoga 4.0.0 for image optimization in development environment.

Some images are getting optimized properly, but for other images I get below error in logs -

23668 16:13:08 ERROR MediaRequestProtection: An invalid/missing hash value was encountered. The expected hash value: 887E26BCD8C75EAB53BDC584A335E9C1. Media URL: /-/jssmedia/projectname/data/media/global/img/site/banners/clip-art/invent-make-change.ashx?h=637&w=1440&hash=F44F69ED2F9DA6026E2C0BE77DA18BD5, Referring URL: http://hostname/en/about

Can anybody please suggest resolution for this error? Should I use a different version of Dianoga with Sitecore 9.2?

  • The hash value is different. I’d recommend to check this link: doc.sitecore.com/developers/92/… and look up how the ‘ HashingUtils.ProtectAssetUrl(mediaUrl)’ works. This should give you some hints. – Roman Klimenko Jan 16 '20 at 15:15
  • Thanks @RomanKlimenko for your comment. I changed the hash value in Sitecore.Media.RequestProtection.config. Still no luck. Same issue is occuring. – NewbieHere Jan 17 '20 at 4:53
0

Dianoga 4 has a lot of known issues. This one was fixed in 5.0 RC2. To get Dianoga working with JSS you'll need Dianoga 5 RC6+.

If you have Dianoga.WebP.config enabled and you're using JSS then you need to also enable the Dianoga.WebP.CDN.config (even on local). This config changes how the WebP detects browser support for WebP by changing it to the page request checking for Accept: image/webp header instead of the image request. This is because JSS at time of writing doesn't pass this header on image requests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.