Caching the response of an ASP.NET HTTP Handler server and client side

Posted by Bert Vandamme on Stack Overflow See other posts from Stack Overflow or by Bert Vandamme
Published on 2010-03-11T16:23:28Z Indexed on 2010/03/11 17:24 UTC
Read the original article Hit count: 254

Filed under:
|
|
|
|

Is it possible to cache the response of a http handler on the server and on the client?

This doesn't seem to be doing the trick:

_context.Response.Cache.SetCacheability(HttpCacheability.Public); _context.Response.Cache.SetExpires(DateTime.Now.AddDays(7));

The _context is the HTTPContext passed as an argument to the ProcessRequest method on the IHttpHandler implementation.

Any ideas?

Update: The client does cache images that are loaded through the httphandler, but if another client does the same call, the server hasn't got it cached. So for each client that asks for the image, the server goes to the database (and filestream). If we use a aspx page instead of a httphandler together with a caching profile, then the images are cached both on the client and the server.

© Stack Overflow or respective owner

Related posts about c#

Related posts about httphandler