This project is read-only.

Error when Output Cache is enabled


When using the RM.Localization module and Output Cache enabled (which is the default in 1.8), an anonymous user accessing the home page throws a null error in the Output Cache module at

var messagesZone = _workContextAccessor.GetContext(filterContext).Layout.Zones["Messages"];

The error message doesn't appear if the user is logged in and/or if the Output Cache module is disabled. I haven't been able to track down further what could be causing the issue, but I've been able to duplicate on two sites so far.


psenechal wrote May 4, 2014 at 7:14 PM

It appears that _workContextAccessor.GetContext(filterContext) is coming back null.

The error on the YSOD is at

Line 157: public void EndProcessRequest(IAsyncResult result) {
Line 158: try {
Line 159: _httpAsyncHandler.EndProcessRequest(result);
Line 160: }
Line 161: finally {

and the error is a general null reference

Object reference not set to an instance of an object.

Disabling either the Output.Cache module or the RM.Localization module resolves the issue.

psenechal wrote May 4, 2014 at 7:49 PM

I think the issue may have something to do with the home page redirect when using the module...I found a reference to it in the Orchard forums. If I disable Output Cache for just the home page, everything seems to work again.

If this is the solution for this problem currently, then I'll go ahead and keep it this way. I'll probably be using Warmup for the home page anyways.