When using IIS as a web server, the response headers of the output aspx page will always automatically include X-Powered-By, X-AspNet-Version, and Server. When using other web servers, you can often get more concise response headers. For high-load websites, saving a few response header items should also save objective traffic. From the programmer's point of view, these header items are exposed to the version used by the website program, and secondly, they also destroy the principle of simplicity. Therefore, there is always a search for ways to get rid of them.
X-AspNet-Version
Just add <httpRuntime enableVersionHeader="false" /> to the <system.web> section of the web.config file. MSDN explains the meaning of this option as follows:
enableVersionHeader
Optional Boolean attributes.
Specifies whether ASP.NET should output version headers. Microsoft Visual Studio 2005 uses this property to determine which version of ASP.NET is currently in use. For production, this property is not required and can be disabled.
Note: This property is not available in the .NET Framework 1.0.
The default value is True.
X-Powered-By
This is the easiest, because in IIS, check the "Properties" of the website, select the "HTTP Header" tab, and you will see that there is an "X-Powered-By" option in the "Custom HTTP Header", just delete it.
X-AspNetMvc-Version
Global.asax.cs file
|