Cache

khi xử lý file ashx , đặc biệt là khi mục đích là tạo ra ảnh phía server, nên thêm đoạn sau vào hàm ProcessRequest để cho phép client cache lại ảnh:
 context.Response.Cache.SetCacheability(HttpCacheability.Public);
            context.Response.Cache.SetExpires(DateTime.Now.AddMinutes(120));
            context.Response.Cache.SetMaxAge(new TimeSpan(0, 120, 0));

Trên IIS, config cache trong mục OutPut Caching

Comments

Popular Posts