ASPX That Returns An Image - Output Cache-able?

和自甴很熟 提交于 2019-12-03 07:36:45

Try dropping the Response.End() as this will terminate the thread prematurely and prevent output caching from taking place.

See: http://bytes.com/groups/net-asp/323363-cache-varybyparam-doesnt-work

You may wish to consider using an ASHX handler and using your own caching method.

Use an ASHX generic handler and use the HttpRuntimeCache (Cache object) to do the job as Codebrain said. It will be faster and WAY more flexible.

Your problem could be a bug in IE - it can't cache if the Vary:* HTTP response header is used, but IIS returns it by default because it's in the HTTP 1.1 spec.

Try adding the following to your web.config:

<system.web> 
    <caching>
        <outputCache omitVaryStar="true" />
    </caching>
</system.web> 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!