Hot answers tagged

14

Your comparison of Dianoga with the other tools isn't quite fair- though what you found is accurate. A few things to point out: Dianoga is lossless compression, which means as the size is reduced, the image should look identical from the version before it was run through the algorithm Sitecore only applies the quality setting to an image if you include ...


8

If you're on Dianoga 2.0.2 I would strongly recommend upgrading to the latest 3.x version. 3.x uses much safer integration methods, is more modular, uses more modern compression tools, and most importantly for your use-case is much smarter about releasing resources.


6

I've used this for a while and can confirm that it works (up to SC 8.2). Furthermore, I just tested it and it still works with Sitecore 9 in PaaS. Once installed, look for Dianoga informational messages in Application Insights after requesting your images. It should look somewhat like this: If you refresh your image (bypassing the browser cache) once it's ...


6

Yes. When media images are requested, Dianoga automatically runs mozjpeg, PNGOptimizer, nQuant, or SVGO on the image data immediately after it is placed in the Sitecore media cache. Dianoga ensures that your site is always serving fully optimised media library images even if you are using Sitecore's dynamic resizing features (for example with Adaptive ...


5

I decided to add my own lossy PNG optimizer using pngquant. It's relatively straight-forward to do so and makes a big difference to file size. If you'd like to use it, you can grab the source from my GitHub fork or see the specific changes I made in the PR to kamsar's source. Do it yourself Download the command-line version of pngquant from here (under ...


5

If the targetframework of the project is lesser than 4.5.2 then try to upgrade the target framework and reinstall the Dianoga from nuget https://www.nuget.org/packages/Dianoga/3.1.1 Also do check if Dianoga.dll is there in bin folder of the application. Similar issue reported at https://github.com/kamsar/Dianoga/issues/22 https://github.com/kamsar/Dianoga/...


4

The easiest way to deploy Dianoga is via nuget with your solution. As long as you add the Nuget package and your build pipeline is doing a Nuget restore as part of the deployment, then the resulting deployment should have everything Dianoga needs to operate. You can confirm by checking that the built solution contains the appropriate assembly (bin\Dianoga....


4

Yes, your idea is correct. Problem is that Sitecore media request protection removes extra parameter extension that is required for Dianoga WebP to work. After adding extension to protected media query parameters: <parameter description="image extension" name="extension"/> everything should work as expected. Pull request to Dianoga that fixes this ...


3

Server-side, no - probably. Dianoga acts as a layer between the Sitecore Media Library and the caching mechanics. You can get the byte size of the images client-side however. Which would allow you to render these in your page. This example lists sizes for all images on your page. Adjust as necessary. var imgElems = document.getElementsByTagName('img'); ...


2

Dianoga by default uses tools that offer lossless images compression. For example, for JPEGs, it uses the jpegtran tool. However in my recent project, after lossless Dianoga compression, Google's Page Speed suggested that images can be compressed by additional 6MB in total on the homepage. After January 2017 Page Speed algorithm changed a bit, and now it ...


1

For jss media you should override jss media handler and patch the same in the config public class ConvertImageToWebp : Sitecore.JavaScriptServices.Media.MediaRequestHandler{ protected override bool DoProcessRequest(HttpContext context, MediaRequest request, Media media){ if ((context?.Request.QueryString?["extension"]?.Contains("...


Only top voted, non community-wiki answers of a minimum length are eligible