public void OnUpdateRequestCache(object o, EventArgs args)
        {
            HttpApplication app     = (HttpApplication)o;
            HttpContext     context = app.Context;


            // Don't want to cache bad stuff
            if (context.Response.StatusCode == 200 && !context.Trace.IsEnabled)
            {
                CachingFilter cf = (CachingFilter)app.Context.Items[context_stream_filter_key];

                context.Items.Remove(context_stream_filter_key);

                _client.Store(
                    Enyim.Caching.Memcached.StoreMode.Set,
                    context.Request.FilePath,
                    cf.GetData());
            }
        }
        public void OnResolveRequestCache(object o, EventArgs args)
        {
            HttpApplication app     = (HttpApplication)o;
            HttpContext     context = app.Context;

            object item = _client.Get(context.Request.FilePath);

            byte[] response = _client.Get(context.Request.FilePath) as byte[];

            if (response == null)
            {
                CachingFilter filter = new CachingFilter(app.Response.Filter);
                app.Response.Filter = filter;
                app.Context.Items.Add(context_stream_filter_key, filter);
                return;
            }

            context.Response.ClearContent();
            context.Response.BinaryWrite(response);

            /// Don't even worry about headers, just let asp.net generate them

            app.CompleteRequest();
        }
        public void OnResolveRequestCache(object o, EventArgs args)
        {
            HttpApplication app = (HttpApplication)o;
            HttpContext context = app.Context;

            object item = _client.Get(context.Request.FilePath);
            byte[] response = _client.Get(context.Request.FilePath) as byte[];

            if (response == null)
            {
                CachingFilter filter = new CachingFilter(app.Response.Filter);
                app.Response.Filter = filter;
                app.Context.Items.Add(context_stream_filter_key, filter);
                return;
            }

            context.Response.ClearContent();
            context.Response.BinaryWrite(response);

            /// Don't even worry about headers, just let asp.net generate them

            app.CompleteRequest();
        }