Image renditions are supposed to be a great way to speed up SharePoint. But if you’ve ever tried to use them in SharePoint Online you have probably noticed that the images load very slow. It’s usually even faster to get the original high resolution image instead. If you look at the network requests, you’ll see that most of the time the browser is just waiting for the server to respond. Actually downloading the image data takes no time at all. But why?
This is what I think is happening: Image renditions rely on front end caching. But SharePoint Online is a huge farm with lots and lots of front ends. When you request an image rendition it will be generated and cached. But the next time you make a request for the same image rendition, the probability that you get a cache hit is very small. You will probably be served by another front end server, and even if you are served by the same server, it handles so many requests that your image rendition has already been dropped from the cache.
Thanks to my friend Dan Andersson for helping me figure out this.
Thanks for the explanation. Any way we can make it faster though? :P
Since I wrote this article, Microsoft has added a feature called “Public CDN” to SharePoint Online. If enabled, some images on publishing sites automatically use the CDN for image renditions. For your own code it is possible to re-write image URLs to fetch image renditions from the CDN instead. This works remarkably well and solves the performance problems!