pallets-eco/cachelib

Magic number in SimpleCache and FileSystemCache

dAnjou opened this issue · 2 comments

The pruning contains a magic number, it seems it deletes only every third entry: idx % 3.

Does anyone know the intention behind this?

I traced it back to the very beginning, there is no info there: mitsuhiko/zine@3502607#diff-b0794f264f02b7241cc1088d07e16659

A wild guess would be that it's there to make it clear that older cache entries can disappear at any time, and applications should support it.

Thanks for reporting the issue. Since #26 has changed the prunning logic I'll go ahead and close this for now. Fell free to reopen it if necessary.