问题描述
在我的ASP.NET 4.0 Web应用程序中,我有一个通用处理程序(.ashx),用于处理存储在数据库中的图像。为了提高效率,我正在处理一些与缓存相关的标头并传递缓存信息。
In my ASP.NET 4.0 web app, I've got a generic handler (.ashx) that serves images stored in the DB. In the interest of efficiency, I'm handling some caching-related headers and passing cache information.
从尝试解析 If-Modified-Since 标头内容,通常来自IE9。事实证明,它发送的是这样的内容:
I'm getting DateTime parse errors moderately frequently from trying to parse the If-Modified-Since
header contents, usually from IE9. Turns out it's sending something like this:
我正在通过使用正则表达式去除最后一部分来处理这一问题。但是我很好奇:它指的是什么长度,它的用途是什么?是请求URL的缓存数据大小吗?
I'm handling that by using a regular expression to strip out the last part. But I'm curious: what length is it referring to, and what use is it? Is it the size of the cached data for the requested URL?
推荐答案
根据:
HTTP / 1.1通过ETag标头和If-None-更好地解决了
相同的问题匹配。
HTTP/1.1 solved the same problem in a better way via the ETag header and If-None-Match.
我猜想IE会在某个时候修改此扩展名并将其保留。
I'm guessing that IE adapted this extension at some point and have left it in.
这篇关于如果IE9传递的If-Modified-Since HTTP标头包含长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!