dev@jersey.java.net

Re: How to make caching work?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 18 Sep 2007 23:16:14 +0200

On Sep 18, 2007, at 9:16 PM, Peter Liu wrote:

> Hi,
>
> I want to start a discussion on how to make caching work in Jersey.
> This is to alleviate some of the concerns regarding the performance of
> REST as an architectural, e.g. amount of round-trip traffic, etc.
>

Right, the stateless and uniform interface constraints can degrade
efficiency but such constraints offer other very desirable properties
and effective use of the caching constraint can reduce the
degradation. Tis all about pragmatic tradeoffs and REST (or certain
constraints) should not be applied if the tradeoffs are considered
too costly. But, having said that it can be rather surprising how the
style can be applicable to scenarios one would not expect it was
applicable to (one does not have to use HTTP as the transport).

Roy's latest talk [1] captures the rational very well, especially
slide 23: "Simplifies, simplifies, simplifies"


> Paul, you mentioned about etags and preconditions in jsr311,
> could you elaborate on this

I will do better and defer to Mark Nottingham's caching tutorial [2].

There are also a couple of other related things like using 100
(Continue) for POST'ing or PUT'ing large files (unfortunately this is
not possible using Servlet) and using ETags/Last-Modified with PUT to
avoid the lost update problem.


> and show how developers can program
> the caching behavior in the resource classes?
>

I will send an email tomorrow how to support caching and preconditions.

Paul.

[1] http://roy.gbiv.com/talks/200709_fielding_rest.pdf
[2] http://www.mnot.net/cache_docs/

> Thanks.
>
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>