'Returns a list of VARY headers.'

def get_vary_cache_on(self, request):

    def inner_plugin_iterator(lang):
        'See    note    in    get_cache_expiration.inner_plugin_iterator().'
        if hasattr(self, '_all_plugins_cache'):
            for instance in self._all_plugins_cache:
                plugin = instance.get_plugin_class_instance()
                (yield (instance, plugin))
        else:
            for plugin_item in self.get_plugins(lang):
                (yield plugin_item.get_plugin_instance())
    if ((not self.cache_placeholder) or (not get_cms_setting('PLUGIN_CACHE'))):
        return []
    vary_list = set()
    language = get_language_from_request(request, self.page)
    for (instance, plugin) in inner_plugin_iterator(language):
        if (not instance):
            continue
        vary_on = plugin.get_vary_cache_on(request, instance, self)
        if (not vary_on):
            continue
        if isinstance(vary_on, six.string_types):
            if (vary_on.lower() not in vary_list):
                vary_list.add(vary_on.lower())
        else:
            try:
                for vary_on_item in iter(vary_on):
                    if (vary_on_item.lower() not in vary_list):
                        vary_list.add(vary_on_item.lower())
            except TypeError:
                warnings.warn(('Plugin    %(plugin_class)s    (%(pk)d)    returned    unexpected    value    %(value)s    for    get_vary_cache_on(),    ignoring.' % {'plugin_class': plugin.__class__.__name__, 'pk': instance.pk, 'value': force_text(vary_on)}))
    return sorted(list(vary_list))
