Caching HttpResponse

Brendt draco2k4 at yahoo.com
Sun Jun 12 06:44:31 EDT 2011


Hi,

I'm looking into caching HttpResponse objects in something like memcached. 
I noticed that HttpResponse does not extend Serializable and none of the
objects it contains (especially the content ChannelBuffer) are Serializable
either.  So I'm trying to think of the best solution around this, and was
wondering if anyone could give me some suggestions.  The one I've come up
with so far is to create an object that contains everything an HttpResponse
has in a Serializable form.  I could then cache that object, pull it out
when required, and create a new DefaultHttpResponse from the cached object. 
Obviously the downside to all of this is the overhead of maintaining this
object and then reconstructing a new DefaultHttpResponse for every cache
hit, but right now I can't think of another bright idea.  So does anyone
have any thoughts/suggestions about this idea (or maybe a better one)?  I'm
hoping someone else has come across this before and may be able to help me
out.

Thanks,
B

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Caching-HttpResponse-tp6466987p6466987.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list