def process_request(self, request):
        if request.method != 'GET':
            return None

        match = get_images_re.match(request.path)
        if not match:
            return None

        image_id = match.group(2)

        # /images/detail is unfortunately supported, so here we
        # cut out those requests and anything with a query
        # parameter...
        # See LP Bug #879136
        if '?' in image_id or image_id == 'detail':
            return None

        if self.cache.is_cached(image_id):
            logger.debug(_("Cache hit for image '%s'"), image_id)
            image_iterator = self.get_from_cache(image_id)
            context = request.context
            try:
                image_meta = registry.get_image_metadata(context, image_id)

                if not image_meta['size']:
                    # override image size metadata with the actual cached
                    # file size, see LP Bug #900959
                    image_meta['size'] = self.cache.get_image_size(image_id)

                response = webob.Response(request=request)
                return self.serializer.show(response, {
                    'image_iterator': image_iterator,
                    'image_meta': image_meta})
            except exception.NotFound:
                msg = _("Image cache contained image file for image '%s', "
                        "however the registry did not contain metadata for "
                        "that image!" % image_id)
                logger.error(msg)
        return None
For requests for an image file, we check the local image
dataset/ETHPy150Open rcbops/glance-buildpackage/glance/api/middleware/cache.py/CacheFilter.process_request