def METHOD_NAME(layer):
    "Utility decorator to cache the topology graph of Netmap"
    def _decorator(func):
        @wraps(func)
        def get_traffic(*args, **kwargs):
            view = kwargs["view"]
            if view is None:
                cache_key = _cache_key("topology", "global_view", layer)
            else:
                cache_key = _cache_key("topology", view.pk, layer)
            try:
                cached = cache.get(cache_key)
                if cached is not None:
                    return cached
            except ValueError:
                pass
            result = func(*args, **kwargs)
            cache.set(cache_key, result, CACHE_TIMEOUT)
            return result
        return get_traffic
    return _decorator