Skip to content
December 21, 2013 / kiranpatils

Do you really need MediaRequestSessionModule? If no, then disable it for better performance!

Challenge:

Before few months back, We were working on performance challenges of our CM Server. And while investigating that we noticed that New Relic (If you are new to New Relic, then just for your information – it is an Application Performance Management Tool and it is your best friend while working on performance challenges) was showing spike in “MediaRequestSessionModule”

To be honest, We were not sure what this module does and is it really required or not?

Oh yes, we raised a support case and that discussion helped us to understand more about this module. Which we think is a worth share with you as well!

Here we go!

Solution:

First we tried to dig in to this issue. But after some point of time. We raised a Sitecore support case. And thanks to Paul Kravchenko for helping us to diagnose such issue.

Here’s a reply:

The  Sitecore.Resources.Media.MediaRequestSessionModule.ContextPostMapRequestHandler() method is just a handler for the standard ASP.NET HttpApplication.PostMapRequestHandler event, please read about it in the following article:
http://msdn.microsoft.com/en-us/library/system.web.httpapplication.postmaprequesthandler.aspx

The “Sitecore.Resources.Media.MediaRequestSessionModule” module was introduced in Sitecore CMS 6.3.0 rev. 100716, please refer to number 328238 in CMS release notes:
http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/ChangeLog.aspx
To ensure that session state is still loaded for media requests when the media item has OMS tracking information, a new Sitecore.Resources.Media.MediaRequestSessionModule has been added to the web.config. (328238)

The matter is that the Sitecore.Resources.Media.MediaRequestSessionModule.ContextPostMapRequestHandler() method parses media request and gets corresponding item from database. This may be the reason of such high time consumption. Actually if you do not use SItecore Analytics you can safely comment out this module.

In summary, Sitecore.Resources.Media.MediaRequestSessionModule module parsed media request and gets corresponding item from database. Which has been introduced in Sitecore CMS 6.3.0 rev. 100716. To ensure that session state is still loaded for media requests when the media item has OMS tracking information. Now, If you do not use Sitecore Analytics you can safely comment out this module!

Just a note : We don’t have any stats which says with/without MediaRequestSessionModule how much % performance gain we get. But when you are working on highly scalable website, On which low response time is expected. You always try to save each drop. And as you know little drop makes a mighty ocean! As we don’t use OMS. So, it makes sense for us to disable it. As Steve jobs taught us let’s be free from clutter, as much as we can!

Happy Sitecoring! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: