Bundling.Extensions.Handlers.BundleHttpHandler.SetBundleHeaders C# (CSharp) Method

SetBundleHeaders() private method

private SetBundleHeaders ( BundleResponse bundleResponse, BundleContext context ) : void
bundleResponse BundleResponse
context BundleContext
return void
		private void SetBundleHeaders(BundleResponse bundleResponse, BundleContext context)
		{
			if (context.HttpContext.Response == null)
			{
				return;
			}

			if (bundleResponse.ContentType != null)
			{
				context.HttpContext.Response.ContentType = bundleResponse.ContentType;
			}

			if (context.EnableInstrumentation || context.HttpContext.Response.Cache == null)
			{
				return;
			}

			HttpCachePolicyBase cache = context.HttpContext.Response.Cache;
			cache.SetCacheability(bundleResponse.Cacheability);
			cache.SetOmitVaryStar(true);
			cache.SetExpires(DateTime.Now.AddYears(1));
			cache.SetValidUntilExpires(true);
			cache.SetLastModified(DateTime.Now);
			cache.VaryByHeaders["User-Agent"] = true;
		}
	}