Symphonious

Living in a state of accord.

Java HTTP Caching Libraries?

So I need to improve out caching support and I really don't want to got through all the pain myself if I can avoid it. Does anyone know of an existing library that just handles client-side caching with the appropriate If-None-Match and If-Not-Modified headers etc. We already have libraries for doing the actually HTTP stuff, I really just need something that knows how to store things on disk and tell me what headers to use to make the request conditional. Oh and we're an applet so small and without dynamic loading or configuration files would be ideal.

It seems to me that all the advice on caching around the web focuses on the server-side and assumes the only that that would ever do client-side caching is an existing browser. Not overly helpful.

  • James Snell says:

    I implemented some very rudimentary client side caching support for Apache Abdera. No guarantees about it’s overall quality but it does work. http://incubator.apache.org/abdera

    March 8, 2007 at 12:41 pm
  • Adrian Sutton says:

    Thanks James,
    The code looks almost precisely like what I need with two problems:
    1. I need Java 1.4 support and the code uses a lot of Java 1.5 syntax.
    2. It seems to have just enough ties into the rest of Abdera to make it difficult to split out.

    I could probably massage it to work but it may be easier to start from scratch and just pinch a lot of ideas/techniques from the code. The tests look particularly like something I want to pillage from. :)

    March 8, 2007 at 1:34 pm
  • Asbjørn Ulsberg says:

    As this is something that would be interesting for a lot of client applications, written in Java and everything else, perhaps the launch of an open source project could be initiated? I could help out with a .NET port that I’d use myself at least.

    March 9, 2007 at 8:25 pm
  • Jonas Anderö says:

    Did you ever find such a comonent? I am looking for a caching lib for java but I’m struggling…

    November 1, 2011 at 9:34 pm
  • Adrian Sutton says:

    Sadly no.

    November 6, 2011 at 6:03 pm

Your email address will not be published. Required fields are marked *

*