Hello Geert,

On 18 February 2010 10:07, Geert van der Ploeg <[email protected]>wrote:

> Hello people,
>
> We are using the repository-adapter for retrieving documents from the
> repository (e.g. running DASL's from within portal or just using the
> webdav-client).
> Responses from the repository are cached, by WebdavServiceImpl,
> WebdavCacheHandler, CachingServiceImpl etc.
>
> However, the cache does not discern positive responses (with HTTP code
> 2xx/3xx) from negative ones (4xx, 5xx).
>

Yes, this is implemented on purpose. The communication between a web
application and the repository can be the most expensive part of the whole
response rendering (unless you're doing something very inefficient). We
chose not only to cache the successful responses but also the unsuccessful
because they may be a part of your logic. E.g. when your default logo can be
overridden by an image in the repository. If it's not in the repository
(404) then use the static one in the web application. Or there may be some
warning document for your homepage in case of emergency which is not present
under normal circumstances. Or some logic is failing in the site and the
site is requesting a non-existent resource (shouldn't happen though but it
does).
In these cases you don't want all the traffic between the web application
and the repository "is this document there?" "no it's not" for every time
the homepage is built up.


> I would like to add that to our environment.
>
> As the above mentioned classes do not provide possibilities for injection
> of a class with does that, I had to create a subclass of CachingServiceImpl.
> (see attached 'NoErrorResponseCachingServiceImpl')
> I'm not fond of this solution.
>
> Would it be possible to either incorporate this behaviour in one of the
> hippo classes or to provide a possibility to inject such behaviour?
> (see attached patches)
>

I wouldn't recommend implementing this behaviour for the reasons mentioned
above. I didn't try it but afaics it's not necessary to inject the
cachingservice. In the web.xml you configure the RepositoryAdapter. You can
extend the nl.hippo.client.webapp.RepositoryAdapter and add your own
cachingservice to the setupService method.
On line 93 it says:
cache = new CachingServiceImpl(new JCSDefaultCache("default") ...
which can be replaced by your own.


> Thanks in advance.
>
> Regards,
> Geert
>
>
Regards,

Jasha Joachimsthal

[email protected] - [email protected]

www.onehippo.com
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 185 H Street, suite B, Petaluma CA 94952 +1
(707) 7734646
********************************************
Hippocms-dev: Hippo CMS 6 development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to