An item can get removed from the cache for two reasons:

1. Cache expiry.
A task runs periodically and checks the last accessed time of each cache
entry and removes it if the entry has not been accessed for sometime

2. Cache eviction
When cache capacity is reached and there is no more space to insert items,
then 25% of the items are (forcefully) evicted (even if they have not
expired).

If the cache is periodically purged even ignoring the above two cases, then
it is incorrect. Such code didn't exist in the early versions of caching
that I implemented.

Azeez

On Fri, Jun 21, 2019 at 12:07 PM Nuwan Dias <[email protected]> wrote:

> Hi,
>
> I have heard about two mechanisms how the cache expires in WSO2 products.
>
> 1. Each cache entry has its individual lifespan specified in the cache
> timeout config (15m by default).
> 2. A scheduled job that runs periodically (based on the cache timeout)
> cleans the full cache on each run. This would mean that some cache entries
> expire sooner than the others.
>
> Which of the above is correct? Or is it completely different? Can we alter
> between the two based on a config?
>
> Thanks,
> NuwanD.
>
> --
> *Nuwan Dias* | Director | WSO2 Inc.
> (m) +94 777 775 729 | (e) [email protected]
> [image: Signature.jpg]
>


-- 
*Afkham Azeez* | Vice President | WSO2 Inc.
(m) +94773320919 | (w) +94117435800 | (e) [email protected]
GET INTEGRATION AGILE
Integration Agility for Digitally Driven Business
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to