如何提高WEB中生成缩略图的效率
我的web系统中,需要浏览缩略图,现在的流程是: 
 1.用户在A页面点击按钮后,提交到服务端开始生成200张图片的缩略图 
 2.生成完成后,跳转到B页面,显示缩略图。   
 现在1,2两个步骤需要将近2分钟,十分耗时。请问该如何提高速度。检查后发现耗时主要是在生成缩略图的时候,生成缩略图的代码如下: 
 foreach   (FileInfo   f   in   fiArr) 
 { 
 //缩略图产生 
 if(f.Extension.ToLower().Equals( ".jpg ")   ||      f.Extension.ToLower().Equals( ".jpeg ")||      f.Extension.ToLower().Equals( ".gif ")||      f.Extension.ToLower().Equals( ".bmp ")||      f.Extension.ToLower().Equals( ".png ")   ) 
 { 
 System.Drawing.Image   oImage   =   System.Drawing.Image.FromFile(f.FullName);    
 int   oWidth   =   oImage.Width;   //原图宽度    
 int   oHeight   =   oImage.Height;   //原图高度    
 int   tWidth   =   90;   //设置缩略图初始宽度    
 int   tHeight   =   90;   //设置缩略图初始高度    
 //按比例计算出缩略图的宽度和高度    
 if(oWidth   > =   oHeight)    
 {    
 tHeight   =   (int)Math.Floor(Convert.ToDouble(oHeight)   *   (Convert.ToDouble(tWidth)   /   Convert.ToDouble(oWidth)));    
 }    
 else    
 {    
 tWidth   =   (int)Math.Floor(Convert.ToDouble(oWidth)   *   (Convert.ToDouble(tHeight)   /   Convert.ToDouble(oHeight)));    
 }    
 //生成缩略原图    
 Bitmap   tImage   =   new   Bitmap(tWidth,tHeight);    
 Graphics   g   =   Graphics.FromImage(tImage);    
 g.InterpolationMode   =   System.Drawing.Drawing2D.InterpolationMode.High;   //设置高质量插值法    
 g.SmoothingMode   =   System.Drawing.Drawing2D.SmoothingMode.HighQuality;//设置高质量,低速度呈现平滑程度    
 g.Clear(Color.Transparent);   //清空画布并以透明背景色填充    
 g.DrawImage(oImage,new   Rectangle(0,0,tWidth,tHeight),new   Rectangle(0,0,oWidth,oHeight),GraphicsUnit.Pixel);    
 string   tFullName   =   oFullDir   +   f.Name;   //保存缩略图的物理路径    
 try    
 {    
 //以JPG格式保存图片    
 tImage.Save(tFullName,System.Drawing.Imaging.ImageFormat.Jpeg);    
 }    
 catch(Exception   ex)    
 {    
 throw   ex;    
 }    
 finally    
 {    
 //释放资源    
 oImage.Dispose();    
 g.Dispose();    
 tImage.Dispose();    
 }    
 } 
 else 
 { 
 continue; 
 } 
 }
------解决方案--------------------up
------解决方案--------------------我有个问题,你的图片是不是会装载到一个img控件上,可以直接设置img的宽和高,这样应该可以吧
------解决方案--------------------那样很大的,速度很慢
------解决方案--------------------那就缓存一下呗
------解决方案--------------------支持楼上!