重複請求我有一個MVC的行動,被稱爲如下:MVC FilePathResult行動導致在Chrome
http://localhost/Report/PrintContainerMasterTrayList?containerMasterId=x&type=downloadview
行動具有以下簽名
public ActionResult PrintContainerInstanceTrayList(int containerInstanceId, string type)
這如下返回FilePathResult :
return File(filename, "application/pdf");
這是除了Chrome中的請求觸發兩次外,沒有任何問題。該請求僅在Firefox和IE11中進行一次。
原始請求
GET http://localhost/DEV-SAF/Report/PrintContainerMasterTrayList?containerMasterId=x&type=downloadview HTTP/1.1 Host: localhost Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Encoding: gzip, deflate, sdch Accept-Language: en-GB,en;q=0.8 Cookie: .ASPXANONYMOUS=-
的第二請求
GET http://localhost/DEV-SAF/Report/PrintContainerMasterTrayList?containerMasterId=x&type=downloadview HTTP/1.1 Host: localhost Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 Accept: */* Referer: http://localhost/DEV-SAF/Report/PrintContainerMasterTrayList?containerMasterId=x&type=downloadview Accept-Encoding: gzip, deflate, sdch Accept-Language: en-GB,en;q=0.8
從兩個請求的響應是相同的(在這種情況下達到一個4Mb的文件,該文件正在使用過多的帶寬)。
是什麼導致了這種行爲?
編輯
從第一請求的響應是 HTTP/1.1 200 OK Cache-Control: private, s-maxage=0 Content-Type: application/pdf Server: Microsoft-IIS/10.0 Set-Cookie: .AUTH=xxxxxx; path=/; HttpOnly X-AspNetMvc-Version: 5.2 Date: Wed, 03 Aug 2016 14:17:41 GMT Content-Length: 3999
從第二請求的響應是 HTTP/1.1 200 OK Cache-Control: private, s-maxage=0 Content-Type: application/pdf Server: Microsoft-IIS/10.0 X-AspNetMvc-Version: 5.2 Date: Wed, 03 Aug 2016 14:17:46 GMT Content-Length: 3999
請求粘貼的內容不相同,例如在查詢字符串中比較containerMasterId = 94101和containerMasterId = x –
對不起,這是我的複製和粘貼。編輯帖子。 – Fishcake
這兩個請求是一起開火還是一個開火? –