cancel
Showing results for 
Search instead for 
Did you mean: 

Client cache enabled but not active

horia
Champ in-the-making
Champ in-the-making
Hi,

I'm looking at Alfresco's logs while fetching documents and I can see that each time I try to retrieve the same doc (same ID), a GET request is made to the remote repository.

I ran a test where I explicitly call
session.getDefaultContext().setCacheEnabled(true)
before calling
session.getObject(id)
several times. It seems the cache is ignored as the GET command is issued each time.

Do you think there may be other properties that should be set on the session that I'm missing? Or maybe some xml configuration for Alfresco?


Thanks
1 REPLY 1

horia
Champ in-the-making
Champ in-the-making
seems to work for getObject if you're using the exact combination of id;version, but for actually retrieving the content, the cache is not used:

Document document = (Document)session.getObject(id); 
document.getContentStream().getStream();


the last line triggers a GET to
alfresco_root/folder/content/doc_name?id=id;version