def METHOD_NAME(user, node, channel_id=None):
    cached_data = cache.get("details_{}".format(node.node_id))
    if cached_data:
        descendants = (
            node.get_descendants()
            .prefetch_related("children", "files", "tags")
            .select_related("license", "language")
        )
        channel = node.get_channel()
        # If channel is a sushi chef channel, use date created for faster query
        # Otherwise, find the last time anything was updated in the channel
        last_update = (
            channel.main_tree.created
            if channel and channel.ricecooker_version
            else descendants.filter(changed=True)
            .aggregate(latest_update=Max("modified"))
            .get("latest_update")
        )
        if last_update:
            last_cache_update = datetime.strptime(
                json.loads(cached_data)["last_update"], settings.DATE_TIME_FORMAT
            )
            if not user.is_anonymous and last_update.replace(tzinfo=None) > last_cache_update:
                # update the stats async, then return the cached value
                getnodedetails_task.enqueue(user, node_id=node.pk)
        return json.loads(cached_data)
    return node.get_details(channel_id=channel_id)