An inverse query engine system having a cache integrated therein and
methods for maintaining the cache are described herein. Entities storing
filters in the inverse query engine cache thus do not have to maintain an
individual cache to maintain the filters. The inverse query engine system
cache is maintained within a bounded size by removing expired filters
from the cache and trimming the cache to an optimal size when the cache
reaches a maximum size. In the event that filter size cannot be
determined efficiently, weights may be associated with filters stored in
the cache, each weight identifying an estimate of a filter size. The
weights are used to determine cache size and to maintain the cache size
within particular bounds.