def shave_caches(self, resource, bbox):


        if isinstance(resource, basestring):
            resource = DataResource.objects.get(slug=resource)
        for layer in resource.renderedlayer_set.all():
            c = self.conn.cursor()
            c.execute('select cache_name from layers where slug=?', [layer.slug])
            for (k,) in c.fetchall():
                MBTileCache.shave_cache(k+'.mbtiles', bbox.extent)
Iterate over all caches using a particular resource and remove any resources overlapping the bounding box
dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/drivers/__init__.py/CacheManager.shave_caches