ok try something like this. This is without cache dependency. But if u use cache dependency then u need to look for key in Debug -> Cache item, Dummy key second table
public void ProcessRequest(HttpContext context)
{
HttpResponse Response = context.Response;
var imageurl = QueryHelper.GetText("imageUrl", String.Empty);
//Get original Picture from Server
string file = context.Server.MapPath("~" + imageurl);
byte[] image = LoadImage(file);
MemoryStream outStream = new MemoryStream(image);
outStream.WriteTo(Response.OutputStream);
outStream.Dispose();
outStream.Close();
//Set response type
context.Response.ContentType = ".jpg";
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
private byte[] LoadImage(string file)
{
byte[] result = CacheHelper.GetItem("croppedimage|" + file) as byte[];
if(result == null)
{
result = GetImage(file);
CacheHelper.Add("croppedimage|" + file, result, null, DateTime.Now.AddMinutes(30), System.Web.Caching.Cache.NoSlidingExpiration);
}
return result;
}