Hi Ivyteam,

According to the javadoc: alt text

I try to store the value by using IDatacach with lifetime's value is 0. Then I expected that it will be expired after 1 minute. But unfortunately, it seems to be infinite time in IvyCach, even I call it again after 5 minutes.

After Hau Tran's TA guy dig into the ivy source code. He found that, there is one condition to check like that if (lifetime > 0) in the method processGroup and processEntry of DataCacheInvalidationJob class.

Now, you see that the java doc make me consufed about the lifetime's explanation.

I am looking forward to hearing any ideas from you :)

Vuong Vu

asked 14.02.2017 at 05:56

vhsvuong's gravatar image

vhsvuong
(suspended)
accept rate: 0%


To expire the cache after one minute I would pass '60' as lifetime (in seconds).

However the fact that the value zero (0) behaves like -1 is for legacy reasons. For a long time the cache was accidentally wrong implemented (lifetime > 0). So many implementations in the field already rely on the fact that 0 is also cached forever. And we'll not change the implementation to keep these old projects happy.

In my opinion it also makes no sense to use a cache which is only valid for less than a second.

link

answered 17.02.2017 at 14:35

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 17.02.2017 at 15:46

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×147

Asked: 14.02.2017 at 05:56

Seen: 1,059 times

Last updated: 17.02.2017 at 15:46