Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes exception when DnnImageHandler returns a cached response #3873

Merged

Conversation

daguiler
Copy link
Contributor

Fixes #3872

Summary

This error occurs when the image was already generated by DnnImageHandler in a previous request and now it's cached in the ~\App_Data\_imagecache folder.

A quick workaround is to switch server cache off, in the web config:

<configuration>
  ...
  <appSettings>
    <add key="DnnImageHandler" value="enableclientcache=False;enableservercache=False" />
    ...

but then of course all images are re-generated everytime.

As explained here and here, the problem is that the System.Web.HttpResponseWrapper.TransmitFile(string) method, followed by Response.End() produces the exception mentioned in #3872.

This sequence can be seen in code, in following lines:


Replacing Response.End() with Response.Flush() fixed the issue.

Copy link
Contributor

@david-poindexter david-poindexter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thanks @daguiler

@donker donker changed the base branch from develop to release/9.6.2 June 29, 2020 08:35
@donker donker added this to the 9.6.2 milestone Jun 29, 2020
@donker donker merged commit 14df698 into dnnsoftware:release/9.6.2 Jun 29, 2020
@daguiler daguiler deleted the bugfix/dnn-image-handler-error branch June 29, 2020 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken images and "The handle is Invalid" error on web farm
3 participants