We have integrated the Geta Image Optimization nuget package with our episerver web project. While running the job it threws the below error on the job history.
Could not load type 'EPiServer.Web.Routing.UrlResolver' from assembly 'EPiServer, Version=220.127.116.11, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'.
Episerver version : 11.9.3
Geta Nuget Version : 0.5.1
Kindly help us...
UrlResolver is marked as abstract in Episerver 11: https://world.episerver.com/documentation/Class-library/?documentId=cms/11/D4E69E2. So I suspect the line in the source is the one causing the problem: https://github.com/Geta/ImageOptimization/blob/3bec81aaec0cea6718ba65a8fbee7e91a2293881/Geta.ImageOptimization/Helpers/ContentExtensions.cs#L21. The fix could be to get IUrlResolver instance instead.
The package is an open source project so I suggest you could fix the issue and send a pull request to the author. I've raised it as an issue on the project on GitHub if you want to contribute: https://github.com/Geta/ImageOptimization/issues/7
Thanks, David. Appreciated!!!
And, We could see the auto image optimization in the Q2 EPiServer release.
We are running on the CMS version 11.9.3. Will the auto-optimization enabled on our version? Do we need to set up any configuration to bring on our site? If it possible, How can we optimize the existing images?
If you are on Episerver Digital Experience Cloud Service (DXC) then it should be automatically applied.
What about other than DXC? Wont it apply or Do we need to do any implementation? Kindly update us...
The automatic image optimisation is provided as part of the Digital Experience Cloud Service (DXC-S) at an infrastructure level. The idea of DXC-S is that it provides partners and customers a service to run Episerver on. So the automatic optimisation isn't provided as part of the software but as part of the service. So I am afraid its not available if you are running a licenced version of Episerver and you will need to find other solutions to your problem. I have previosuly blogged about automatically compressing images when they are first uploaded to Episerver using TinyPNG here:
Geta Image Optimization Job is working good after the version upgrade.There was only two changes needed after dll upgrade.
1. BlobFactory in ImageOptimizationJob.cs got deprecated,
change BlobFactory as IBlobFactory - var blobFactory = ServiceLocator.Current.GetInstance<IBlobFactory>();
2. BuildUrl() in SmushItProxy.cs was returning invalid url due to endpoint variable, returning empty string as value
change endpoint - string endpoint = "http://api.resmush.it/ws.php"; or give the value in web.config
better require that `IBlobFactory` dependency from constructor. avoid ServiceLocator.