Files
mono/mcs/class/System.Web/System.Web.Caching/CachedRawResponse.cs
T
Jackson Harper 1889af35df * OutputCacheModule.cs: Store a CachedVaryBy object for each
cached page. Then store a CachedRawResponse for each combination
	of varried parameters for a page.
	* CachedRawResponse.cs: Do not need to store param values anymore
	those are stored in the CachedVaryBy now. Get the content length
	so we dont send back the entire buffer.
	* CachedVaryBy.cs: New file - holds the varyby data for a page,
	and a method to generate a key based on params. Right now this
	only works with VaryByParams. TODO: support VaryByHeaders and
	VaryByCustom.

svn path=/trunk/mcs/; revision=20333
2003-11-22 06:53:51 +00:00

80 lines
1.5 KiB
C#

//
// System.Web.Caching.CachedRawResponse
//
// Author(s):
// Jackson Harper ([email protected])
//
// (C) 2003 Novell, Inc (http://www.novell.com)
//
using System;
using System.Text;
using System.Collections;
namespace System.Web.Caching {
internal class CachedRawResponse {
private HttpCachePolicy policy;
private Hashtable vparams;
private int status_code;
private string status_desc;
private int content_length;
private ArrayList headers;
private byte[] buffer;
internal CachedRawResponse (HttpCachePolicy policy)
{
this.policy = policy;
this.buffer = new byte [HttpWriter.MaxBufferSize];
}
internal HttpCachePolicy Policy {
get { return policy; }
set { policy = value; }
}
internal int StatusCode {
get { return status_code; }
set { status_code = value; }
}
internal string StatusDescription {
get { return status_desc; }
set { status_desc = value; }
}
internal int ContentLength {
get { return content_length; }
set { content_length = value; }
}
internal ArrayList Headers {
get { return headers; }
}
internal void SetHeaders (ArrayList headers) {
this.headers = headers;
}
internal void SetData (byte[] buffer)
{
this.buffer = buffer;
}
internal void SetResponseHeaders (HttpResponse response)
{
foreach (HttpResponseHeader hdr in headers)
response.AppendHeader (hdr.Name, hdr.Value);
}
internal byte[] GetData ()
{
return buffer;
}
}
}