On Mon, Jul 7, 2008 at 10:49 AM, Marijn Speelman <[EMAIL PROTECTED]> wrote:
> I'm a bit confused about the configuration of caching in Java Shindig.
>
> From what I can see, when a gadget render request is made the spec can come
> from three locations:
> - In-memory gadget-spec cache.
> - In-memory http reponse cache.
> - The real http location.
>
> By default the gadget and message bundle spec capacities are:
>
> file: gadgets/conf/gadgets.properties:
> gadget-spec.cache.capacity=0
> message-bundle.cache.capacity=0
>
> I've implemented an extra memcached layer on top of BasicHttpCache and I
> want to be sure that I understand the caching process completely.
>
> Is it true that this effectively turns these two caches off, because
> whenever an element is added to the cache, it will be thrown out immediately
> because the size exceeds the capacity?
> In other words: is this the way to choose between http response caching OR
> just the gadget/messagebundle caching?
You should use both. The manifest files (gadget spec + message bundles)
should be cached in memory because the cost of parsing the xml is fairly
significant (in profiling, it's by far the most expensive operation in the
stack, even beating out link rewriting). The HTTP cache is more general
purpose, and in a production environment you would always want to use a
distributed cache such as memcache.
>
> Some more documentation about the different places and ways of caching and
> configuration would be also be greatly appreciated. For instance, is there
> any place where the use of the client-side caching parameter version ("v=")
> is documented? Although it's a simple concept, I could only find it by
> digging through the code.
There really isn't much by way of "user documentation" for Shindig right
now, though it would definitely be a welcomed contribution. We mostly keep
things on confluence (http://cwiki.apache.org/SHINDIGxSITE), but a wiki
solution with more open access would be nice.
>
>
> Thanks,
>
> Marijn
>