当映射到通过 asp.net 引擎处理所有请求时,IIS6 日志文件将块报告为已完成的 pdf 文件下载

发布于 2024-12-19 15:07:51 字数 1381 浏览 0 评论 0原文

在带有 IIS 6 的 Windows 2003 SP2 服务器上,我们将 IIS 配置为使用 aspnet_isapi.dll 通过 ASP.NET 引擎处理所有请求 如此处所述 http: //professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-Extensions-in-ASP.NET.aspx 更改后,我们注意到 pdf 文件的点击量大幅增加。

例如,在我们进行更改之前,一个 7Mb 文件在一天内被“点击”78 次,如 HTTP 状态 200 所示。 更改后,同一文件在一天内报告了 22,000 次“点击”。

在查看日志时,似乎每个块都返回 200 的 http 状态,而不是完成下载。 这是更改前日志文件的摘录,

cs-method sc-status sc-substatus    sc-win32-status sc-bytes
GET       200   0       0       7452463     
HEAD      200   0       0       259         
GET       200   0       0       7452463     
HEAD      200   0       0       259

第一行和第二行代表来自一个 IP 地址的请求,第三行和第四行来自第二个 IP 地址

,这是我们进行更改后创建的日志文件的类似摘录

cs-method   sc-status  sc-substatus sc-win32-status sc-bytes
GET     200     0       0       7379092 
GET     200     0       0       102331  
GET     200     0       0       4249
GET     200     0       0       4212
GET     200     0       0       4521
GET     200     0       0       477
GET     200     0       0       4521
GET     200     0       64      196608
GET     200     0       0       6740403

第一个请求来自一个 IP 地址,而其余行来自第二个 IP 地址。

我的问题是这样的。有没有办法让我将 pdf 文件的下载记录为一次点击,就像我进行更改之前那样?

On a Windows 2003 SP2 server with IIS 6, we configured IIS to process all request through the ASP.NET engine using aspnet_isapi.dll
as outlined here http://professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-Extensions-in-ASP.NET.aspx
After the change, we noticed a huge increase in hits for pdf files.

For example, before we made the change, a 7Mb file was "hit" 78 times in a day as indicated by an HTTP status of 200 .
After the change, that same file reported 22,000 "hits" in a single day.

In looking at the logs, it seems that the http status of 200 is being returned on every chunk, instead of for a completed download.
This is an extract from the log file before the change

cs-method sc-status sc-substatus    sc-win32-status sc-bytes
GET       200   0       0       7452463     
HEAD      200   0       0       259         
GET       200   0       0       7452463     
HEAD      200   0       0       259

the first and second line represent a request from one ip address, the third and fourth are from a second IP address

and here is a similar extract from a log file created after we made the change

cs-method   sc-status  sc-substatus sc-win32-status sc-bytes
GET     200     0       0       7379092 
GET     200     0       0       102331  
GET     200     0       0       4249
GET     200     0       0       4212
GET     200     0       0       4521
GET     200     0       0       477
GET     200     0       0       4521
GET     200     0       64      196608
GET     200     0       0       6740403

The first request is from one IP Address, while the remaining lines are from a second IP address.

My question is this. Is there a way for me to cause the download of a pdf file to be recorded as a single hit, as it seemed to before I made the change?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝眸 2024-12-26 15:07:51

在我看来,日志正在记录实际的请求,并且客户端的浏览器决定将其拆分为多个块以提高下载效率。

如果该项目的目的是用于报告,我建议创建一个解析器应用程序/服务来计算特定时间范围内按 IP 地址的 PDF 点击率,而不是尝试破解日志记录机制。

It seems to me that the log is logging the actual requests, and it's the client's browser which decided to split it into chucks for more efficient downloading.

If the purpose of this project is for reporting, I would recommend creating a parser app/service to count PDF hits by IP address within a certain timeframe, rather than trying to hack the logging mechanism.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文