2012年11月7日

HttpWebRequest开启gzip压缩

摘要: 在用HttpWebRequest对象时,一般我们都没有开启gzip压缩,如果服务端返回的数据比较大,这是我们需要开启gzip压缩,怎么开启了?1.给HttpWebRequest对象,添加如下Header request.Headers.Add("Accept-Encoding", "gzip");2.对接收到的流进行解码private string GetResponseBody(HttpWebResponse response){string responseBody = string.Empty;if (response.ContentEncodin 阅读全文

posted @ 2012-11-07 21:21 dz45693 阅读(2781) 评论(0) 推荐(1) 编辑

OutputCacheProvider OutputCache的一点点认识

摘要: 在asp.net4.0后我们可以实现自己的OutputCacheProvider来控制缓存的位置了,但是我发现很多人多OutputCacheProvider的调用并不是很清楚。首先我们要知道缓存是在哪里注册的。答案是OutputCacheModulevoid IHttpModule.Init(HttpApplication app){ if (RuntimeConfig.GetAppConfig().OutputCache.EnableOutputCache) { app.ResolveRequestCache += new EventHandler(this.OnEnter); ... 阅读全文

posted @ 2012-11-07 15:51 dz45693 阅读(3438) 评论(3) 推荐(1) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示