数据压缩

<httpCompression>节点用于配置静态压缩和动态压缩,<urlCompression>则用于开关 http压缩

  <urlCompression doStaticCompression="true" />
<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>

security

maxAllowedContentLength设置上传文件的最大值,allowDoubleEscaping是否检查URL含有+号的情况

  <security>
<requestFiltering allowDoubleEscaping="true">
<requestLimits maxAllowedContentLength="10000000" />
</requestFiltering>
</security>

mailSettings

主要有利于SmtpClient,如果把配置写在APPSetting中需要手动去填充参数,如果使用mailSettings,情况就变得非常简单

smtp = new SmtpClient(); smtp.Send(msg);

  <system.net>
<mailSettings>
<smtp from="lnred@lexisnexis.com.au">
<network host="smtp.sendgrid.net" port="25"
userName="azure_b1d335d1d151b1708ffa17cfabc2ad3d@azure.com"
password="onr4qv2s" />
</smtp>
</mailSettings>
<defaultProxy enabled="true" />
</system.net>

httpProtocol

貌似Remove Server不起作用

    <httpProtocol>
<customHeaders>
<!--<add name="Arr-Disable-Session-Affinity" value="true" />-->
<remove name="Server" />
<remove name="X-Powered-By" />
<remove name="X-AspNet-Version" />
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>

system.web

maxRequestLength和maxAllowedContentLength具有相似的目的,
建议设置成相同的值,具体参考https://forums.iis.net/t/1169846.aspx

  <system.web>
<compilation targetFramework="4.6" debug="false" />
<httpRuntime targetFramework="4.6" maxRequestLength="10000" maxUrlLength="1024" />
<customErrors mode="RemoteOnly" defaultRedirect="~/error.html" />
</system.web>

Web Config配置备忘的更多相关文章

  1. 生产服务器环境最小化安装后 Centos 6.5优化配置备忘

    生产服务器环境最小化安装后 Centos 6.5优化配置备忘 作者:Memory 发布于:2014-8-13 15:00 Wednesday 服务器 本文 centos 6.5 优化 的项有18处: ...

  2. 生产服务器环境最小化安装后Centos 6.5优化配置备忘

    生产服务器环境最小化安装后 Centos 6.5优化配置备忘 本文 centos 6.5 优化 的项有18处,列表如下: 1.centos6.5最小化安装后启动网卡 2.ifconfig查询IP进行S ...

  3. Manjaro启动项目及服务配置备忘

    Manjaro启动项目及服务配置备忘 =============== 系统服务GUI管理搜索 systemdgenie 并安装,类似Windows的服务管理. ================ 系统启 ...

  4. jenkins持续集成配置备忘

    配过好几次,但是老忘记.记录备忘. 安装下列插件: ssh和git插件用来下载源码 publish over ssh 插件用来发布代码到测试环境. email插件用来更强大的email配置. file ...

  5. mac中apache+mysql+php+phpMyAdmin配置备忘

    Mac OS X 内置Apache 和 PHP,使用起来非常方便.本文以Mac OS X 10.6.3和为例.主要内容包括: 启动Apache 运行PHP 安装MySQL 使用phpMyAdmin 配 ...

  6. nginx配置备忘

    一.本地测试环境配置 upstream gongsibao{ server ; server ; #fair; } server { listen ; server_name ubuntu00.xus ...

  7. centos nfs配置备忘

    [需求]web应用需要部署在两台机器,图片目录共用,MySQL共用. [环境]Server: 192.168.168.10Client: 192.168.168.20 [配置步骤]1.在两台机器上安装 ...

  8. vps_centos_7_系统环境常规配置备忘

    1.设置时区(东八区) 1> 选择亚洲东八区北京时间:tzselect (按照提示选择指定的序号直到北京时间) 2>替换时区文件 :cp /usr/share/zoneinfo/Asia/ ...

  9. Nginx基本配置备忘

    原文:http://www.open-open.com/lib/view/open1482477873078.html Nginx 配置 在了解具体的Nginx配置项之前我们需要对于Nginx配置文件 ...

随机推荐

  1. 手机浏览器浏览WebApp弹出的键盘遮盖住文本框的解决办法

    手机浏览器浏览WebApp弹出的键盘遮盖住文本框的解决办法 最近碰到Android微信内置浏览H5页面,因为其中的文本输入框(input)放置在靠近页面的中下方,点击文本框以后,则输入框会被弹出的手机 ...

  2. javascript关闭页面

    var browserName=navigator.appName; if (browserName=="Netscape") { window.open('','_parent' ...

  3. caffe源码解析

    http://blog.csdn.net/lanxuecc/article/details/53186613

  4. 使用winmm.dll 获取麦克风声音数据

    //录音 /// <summary> /// 初始化录音环境 /// </summary> /// <returns></returns> public ...

  5. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法

    原因1:给定目录下jvm.dll不存在. 对策:(1)重新安装jre或者jdk并配置好环境变量.(2)copy一个jvm.dll放在该目录下. 原因2:eclipse的版本与jre或者jdk版本不一致 ...

  6. tomcat/jsp/servlet版本关系

    Servlet Spec JSP Spec EL Spec WebSocket Spec JASPIC Spec Apache Tomcat version Actual release revisi ...

  7. 【总结】.Net面试题集锦(一)

    一.背景 最近一直在准备面试,收到的面试邀请邮件里还有面试题,真是要当面霸的节奏,不过看看也好,一方面能够锻炼锻炼生锈的脑子,查缺补漏一下,另一方面,万一靠这几个面试题拿到offer呢,哈哈.开个玩笑 ...

  8. 2 云计算系列之KVM的安装与使用

    preface 在上篇博客中,我们讲了云的概念,分类,以及虚拟化技术.我们知道Openstack的虚拟化技术是基于KVM的,所以下面就开始说说如何部署和使用KVM. 下面的讲解包含以下知识点: 安装K ...

  9. CSS-学习笔记三

    绝对定位:1. 脱离了文档流,没有浮动效果2. 默认情况下,设置了绝对定位的块,它的Top,left是相对于浏览器的3. 当给设置了绝对定位的块的父元素设置定位的时候(绝对.相对.固定),    那么 ...

  10. 移动端 Web 开发前端知识整理

    文章来源: http://www.restran.net/2015/05/14/mobile-web-front-end-collections/ 最近整理的移动端 Web 开发前端知识,不定期更新. ...