How to optimize images served through the dispatcher

1.2k views Asked by At

I'm working on a CQ5.5 instance. I'd like to always serve up web optimized images. That is, images that have been optimized to reduce their size without affecting the quality. I've found that even when I run image renditions created by CQ workflows through a tool like Yahoo Smushit the tool is still able to reduce the size of the images. So this leads me to believe the CQ renditions are not fully web optimized.

I haven't found any CQ guidance on how to optimize images that are fetched through the dispatcher, which in my case is a Windows IIS-based dispatcher. I've explored options and considered the following:

  1. Perhaps some CQ config setting exists to enable this and I am simply unaware? This would be the easiest, but searches lead me to believe this isn't a feature (yet?).
  2. Add some sort of module that would do image optimization processing on a HTTP response and optimize an image (probably too much performance impact to do this every request, though, unless it can run only when fetching non-dispatcher-cached images from a publisher).
  3. Alter the dispatcher cached files on disk after they have been created so subsequent requests get a web-optimized version.
  4. Customize a workflow to optimize images when creating renditions. However, I find sometimes pages have direct references to the original DAM image, which may not be optimized, and I'd like to also optimize these image requests and not just rendition requests. This wouldn't affect all HTTP image requests.
  5. Add Java code that runs on a publisher to post-process HTTP image requests that hit the publisher and return an optimized image (which would then be dispatcher-cached).

Option 5 seems the most promising, but I don't know how to do that in CQ5. Other options also likely exist. How can I optimize images served up by the dispatcher--what is the best method, how is that method implemented?

1

There are 1 answers

1
Robert Munteanu On

Typically I would suggest installing mod_pagespeed, but I see you're running IIS. A quick search shows that there is a IIS alternative, named IISpeed. I suggest you give it a try, it should be an easy experiment.