def is_side_effect_free(request):
    """
    Is the request side-effect free? If the answer is yes, we should
    be able to quietly abort the transaction and avoid taking out any
    locks in the DBs.

    A request is considered to be free of side effects if:

        - It is a GET or HEAD request; AND

        - The URL DOES NOT match a configured exception list.

    In this version, the configured exception list is not actually
    configurable. It is hardcoded to handle the case of socket.io
    polling (which does have side effects on GET requests), while
    still supporting serving the static resources of socket.io.
    """
    if request.method == 'GET' or request.method == 'HEAD':
        if 'socket.io' in request.url:
            return 'static' in request.url
        return True
    return False
