Sitecore Image Optimization

Optimize Images

Time and time again you see yourself solving an issue or providing a solution to a problem that seem to exist regardless of breadth of solution.  One such problem I noted on my clients is Images, no matter how advanced the actual sitecore implementation is, for some reason Images and their handling are not taken seriously enough.

On the projects where I am leading the technical effort, I almost always ensure and push the team to think about this because when we launch the site, it is sure very important to get the functionality right, but, what is also important is to ensure tools like Google page speeds and others out there give your effort a good ranking.  You might say, well it is just a number, but, it is important to understand the number is mere representation how fast and efficient your solution is and hence the numbers and issues are important.  At the end of the day, you want to see your website where you put in so much effort and money lands well on Google. 🙂

I am a true believer that we should never be re-inventing the wheel and always see where we can get with couple of smart solutions out there that folks use for this very purpose.  I toyed around with couple of options and compared them on different aspects, so, we can make a decision on next steps to get us where we would like to be.

Below are my findings on this comparison.

Note:  I am not supportive of either of these options I researched and only providing my thoughts around it.  Not meaning to offend any one or praise any one either.  🙂

Please leave a comment if you have any more thoughts or options that could prove to be useful.

Tools investigated are:

Dianoga – https://github.com/kamsar/Dianoga/blob/master/README.md

Image Crunch – https://github.com/1508/SitecoreExtension.ImageCrunch

Comparision Sheet between the favorites

DianogaKraken Based API calls
Installation and Set upWorks OOTB, no need to tailor or modify unless very specific needs arise
If CDN is in play, additional configuration might be needed. See some more steps noted for CDN set up here:
https://github.com/kamsar/Dianoga
We will need to test with CDN in play to ensure it still works with this additional steps
• Would need some honing as module does not seem to be perfect and need some issues to be addressed. See Git hub notes by me to the author –
https://github.com/vishalniit/InSitecore.Sitecore.ImageCrunch/issues/1
• API keys based on subscription for Kraken
Custom CodeNot needed for optimization specificallyWill be needed more than likely to ensure we tailor the solution to our needs. Can take reference from the module suggested and make it our own.
SubscriptionFreeMonthly subscription needed
https://kraken.io/pricing
Google Page SpeedStill few images not compressed to what Google expects it to be at.
But, I came to know that Dianoga works it's best with scaling parameters, so check that out if your implementation does not have scaling in place.
Compression respected by Google algorithm
Served FromMedia Cache
Image should be available on media cache which is based on request to the resource, so, optimization is on-demand
Media Library
Hook is on media library, so, every time a new image is uploaded or attached Kraken is called to Optimize the same if needed.
For existing images, there are few calls we can make right from content author ribbon.
Publish would be needed to ensure optimized images are being served upon request
Cache should be cleared if not already in play on CDN to ensure newly optimized images will be served

That is it you guys, hopefully this helps some one looking for a solution to optimize their Sitecore imagery.  Both of these options are unique in terms of how they deal with the problem on hand.  Ultimately, both seem to be good, so, picking an option would be mainly based on business and development teams preference based on their implementation.

Archive/Restore Options for Sitecore

versions

There are many legally obligated companies that would still pick Sitecore for it’s immense power and flexibility that comes out of the box and the constant push towards reaching marketing goals is one of the other main reason why.

The biggest challenges they are facing currently is the legal battles these heavy financial companies face to maintain old/stale data for compliance reasons.  Even if they have a third party crawler of some sort that would capture screenshots of how sites are rendered at scheduled times, due to Personalization and other contextual driven content, they do need some way to tap on to all history and can not risk loosing it for Audit purposes.

I have seen some clients that kept storing all versions in all languages which would lead to bad performance of content editor and slow content authoring experience.  Sitecore recommends not more than 10 versions to be stored on CM side.

I have been researching to find few decent options to steer them to correct path which is to trim their versions.  I must say that I could not find next to none which are robust and easy to use, especially that utilize Sitecore Archiving instead of Serialization to a item file on file system.  I sure found couple blogs and references to build something, but, it would be nice to have feature which would be harnessed and appreciated by most of the audit heavy clients.

Would love to get some feedback and tools you all typically use for Archiving the outdated Item versions.  Do note that this should work on a load balanced CM environment. 🙂

Looking forward to hear any feedback on this, I currently, based on research out there found three options overall and I am listing down pros and cons on each.  But, if any of you know more, please reach out.

Option 1 – Manual Route

Sitecore provides manual way for content author to archive versions on need basis and there is a UI that could be utilized to restore the version of choice.

https://doc.sitecore.net/sitecore_experience_platform/82/content_authoring/managing_items/general/archive_and_restore_an_item

Option 2 – Custom with a Twist

The Guru, John west, has a blog that is neat and could help with a solution that could be custom built.

https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/rules-engine-actions-to-remove-old-versions-in-the-sitecore-asp-net-cms

Also, I did find a module that took inspiration from option 3 that is coming next and blog provided above, but, unfortunately it does not support multi-lingual at this time and customization would be needed to be able to use the same.

Introducing the ‘Sitecore Version Pruner’ shared source module!

Option 3 – The Legacy Module (Version Manager)

https://marketplace.sitecore.net/en/Modules/Version_Manager.aspx

If you have ever read through performance tuning document, Sitecore did recommend on versions 7 to have in version manager to help mitigate number of versions.

FYI, currently due to lack of time, the module is not being actively maintained per author’s comment, but, it could be tested and utilized if your business demands are satisfied.  But, do note that this uses file serialization mechanism for restoration and archiving, so, it would be tedious to restore and not as straight forward as Archiving that is possible on later versions of Sitecore.

 

I had created sitecore support ticket to find out if there is more that I can quickly go ahead and use and the answer was no, so, they created a feature request, would love to get this ticket escalated.  If you wish to track it, here is the number – 198728