def _get_topic_memcache_key(topic_id, version=None):
    """Returns a memcache key for the topic.

    Args:
        topic_id: str. ID of the topic.
        version: int. The version of the topic.

    Returns:
        str. The memcache key of the topic.
    """
    if version:
        return 'topic-version:%s:%s' % (topic_id, version)
    else:
        return 'topic:%s' % topic_id