'Determine the version of the url and extract the image id
:returns: tuple of version and image id if the url is a cacheable,
otherwise None'

@staticmethod
def _match_request(request):

    for ((version, method), pattern) in PATTERNS.items():
        if (request.method != method):
            continue
        match = pattern.match(request.path_info)
        if (match is None):
            continue
        image_id = match.group(1)
        if (image_id != 'detail'):
            return (version, method, image_id)
