, "script", Picture.aspx, , # , script.
API , ASP.NET.
, , - . API :
string fileName = ...
byte[] bytes = null;
if (HttpContext.Current.Cache[fileName] != null)
{
bytes = (byte[])HttpContext.Current.Cache[fileName];
}
else
{
bytes = ...
HttpContext.Current.Cache[fileName] = bytes;
}
Response.BinaryWrite(bytes);
Response.Flush();
, , , , , .
EDIT:
, :
Response.Cache.SetCacheability(HttpCacheability.Public);
HttpCacheability. , . (, , - )
ASP.NET HTTP.
, (, ), " !"
, .
2:
- SetExpires(DateTime.Now.AddTicks(600)). 600 - ... (1 = 10000000 )
, , , .
:
context.Response.Cache.SetExpires(DateTime.Now.AddMinutes(5));
context.Response.Cache.SetMaxAge(TimeSpan.FromMinutes(5));
(TimeSpan.FromMinutes , new TimeSpan(...).)