[ALF-22060] Reader on the backing store is obtained twice in CachingContentStore Created: 18-Jan-19 Updated: 16-Oct-19 Resolved: 14-Feb-19
|Fix Version/s:||ACS 201910-EA|
|Security Level:||external (External user)|
|Reporter:||Nicolas Barithel||Assignee:||Closed Issues|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Date of First Response:|
|Resolution Time Custom Field:||3 weeks, 5 days, 20 hours, 11 minutes, 33 seconds|
When using the CachingContentStore and acquiring a reader, the first time a content is needed or if the content is missing from the cache it is obtained from the backing store.
This is expected, but the actual result is that the reader is retrieved twice from the backing store (first time only the size is checked, to ensure quota is not exceeded) which can be improved.
For your reference, here is the list of all invocations:
|Comment by Nicolas Barithel [ 18-Jan-19 ]|
Pull request submitted : https://github.com/Alfresco/alfresco-repository/pull/329
|Comment by Stefan Kopf [ 21-Jan-19 ]|
Closed PR and left a long comment there.
When a store is asked for a Reader, it should not perform any operations and immediately return a java object implementing the ContentReader interface. This implementation should not perform any operations until it is actually asked to do so.
The CachingContentStore is not about caching the ContentReader object. It is about caching the actual binary content.
|Comment by Nicolas Barithel [ 21-Jan-19 ]|
Detailed explanation provided in the PR. It should clarify the goal and why it does not change the current behavior.
|Comment by Stefan Kopf [ 04-Feb-19 ]|
I had a look into the PR again. I missed the point that the .put() into the cache actually copies the bytes. We will put this in the queue to be reviewed and merged.
|Comment by Erik Knizat [ 14-Feb-19 ]|
Merged the PR