This project is read-only.


OutputCache returns nothing when a controller returns a FileResult


OutputCache module only allow the output of ViewResult. If you want to rerturn a FileResult in your controller and Output cache is activated, it returns nothing

Reason is this code within OutputCacheFilter.cs file:
  // only for ViewResult right now, as we don't want to handle redirects, HttpNotFound, ...
     if (filterContext.Result as ViewResultBase == null) {
         Logger.Debug("Ignoring none ViewResult response");
You can read more info related with this problem in this discussion thread


dbertolin wrote Sep 30, 2013 at 2:27 PM

I have the same problem, there is workaround?

DeejayRaoul wrote Oct 7, 2013 at 1:42 PM

I've created a custom cropper tool outputting an image either from disk or real-time cropped from a stream.
This worked in 1.6 but has been broken in 1.7.
Any pointers as to where to fix this myself, or is there a fix allready in a recent version?

Piedone wrote Oct 7, 2013 at 2:45 PM

You could set up the route to be ignored until there's a fix.

sebastienros wrote Oct 8, 2013 at 6:35 PM

The bug is not related to the code you mention (outdated code) but as a workaround you can add [OutputCache(Duration = 0)] to your controller or your action

sebastienros wrote Oct 8, 2013 at 7:55 PM

Fixed in changeset dd852c33171437f6da6944aa78bbe779ad79de43