/// <summary> /// Sets the output cache parameters and also the client side caching parameters /// </summary> /// <param name="context"></param> /// <param name="fileName">The name of the file that has been saved to disk</param> /// <param name="fileset">The Base64 encoded string supplied in the query string for the handler</param> /// <param name="compressionType"></param> /// <param name="page">The outputcache page - ensures server side output cache is stored</param> private void SetCaching(HttpContextBase context, string fileName, string fileset, CompressionType compressionType, OutputCachedPage page) { //this initializes the webforms page part to get outputcaching working server side page.ProcessRequest(HttpContext.Current); // in any case, cache already varies by pathInfo (build-in) so for path formats, we do not need anything // just add params for querystring format, just in case... context.SetClientCachingResponse( //the e-tag to use (fileset + compressionType.ToString()).GenerateHash(), //10 days 10, //vary-by params new[] { "t", "s", "cdv" }); //make this output cache dependent on the file if there is one. if (!string.IsNullOrEmpty(fileName)) context.Response.AddFileDependency(fileName); }