开发者

Properly respond to a HEAD request

I have an IHttpHandler serving dynamically generated files. I wish to respond to HEAD requests to let the client know whether the file has c开发者_开发百科hanged.

I need to send the last change date and the file size, do I have to use Response.AddHeader() or is there a cleaner way?


For the last modified time, you can call:

Response.Cache.SetLastModified()

Are you sure you need to set the size? The Framework usually takes care of that automatically, based on the actual size of the response.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜