1. A method for performing caching in an image-processing system, comprising: receiving a filtering query for resources in a cache; returning a subcache in response to the filtering query; and upon receiving a resource query for resources in the subcache, performing the filtering query on the cache, populating the subcache with addresses of resources returned by the filtering query until the resource query is satisfied, and returning available resources from the subcache in response to the resource query.