Thursday, February 14, 2013

How to cache image in httphandler?

        public void ProcessRequest(HttpContext context)
        {
            context.Response.BinaryWrite(Image2Byte(CreateBitmapImage("Hello World")));
            context.Response.Cache.SetCacheability(HttpCacheability.Public);
            context.Response.Expires = 100;
        }