问题
I have one asp.net page which seems to return a very big content (5,648,733 bytes and that is
mostly consumed by VIEWSTATE) ending with a 504 Gateway timeout error. I am tracking the http
request/response by using Fiddler.
And basically, when I post-back the same page -by clicking a button- the post-back fails with thoose errors shown in IE and in FF:
Internet Explorer cannot display the webpage --> in IE
The connection to the server was reset while the page was loading. --> in FF
Question: Can this be because of the big size injected in VIEWSTATE; and if yes, what is the main reason so that it loads the page but cannot post the page back after?
回答1:
I wonder if you are hitting the MaxRequestLength of the application; Default is 4MB.
回答2:
There are many places where a request can timout. The timeout will occurr in the link in the chain that has the lowest timeout.
You should check if you have any proxy settings in IE.
回答3:
Thank you Chris Shaffer!
After you point me out that I have changed the MaxRequestLength of the application by adding this line to my web.config:
<httpRuntime maxRequestLength="60240"/>
And tested the page to see whether it works. And it did!
So, now I have to find a way to reduce ViewState of the GridView on that page.
来源:https://stackoverflow.com/questions/4194741/can-big-viewstate-content-result-a-http-error-504-gateway-timeout