Ok, how about instead of using a view at all, we instead just have the cron job write the sitemap to the filesystem and configure Apache to serve it from there. 

Kohei Yoshino <notifications@github.com> wrote:
>> @@ -260,3 +261,34 @@ def render_to_response(self, context,
>**response_kwargs):
>>                                   self.get_template_names(),
>>                                   context,
>>                                   **response_kwargs)
>> +
>> +
>> +class SitemapXML(TemplateView):
>> +    template_name = 'mozorg/sitemap.xml'
>> +
>> +    def get_context_data(self, **kwargs):
>> +        # Force update with the Cache-Control HTTP header
>> +        if 'no-cache' in self.request.META.get('HTTP_CACHE_CONTROL',
>''):
>> +            from bedrock.mozorg.cron import update_sitemap
>> +            update_sitemap()
>> +
>> +        locale = self.request.GET.get('locale', None)
>> +        urls = cache.get('sitemap_urls', {})
>
>As I described, it currently takes 30+ seconds to update the sitemap
>cache. We have to remove the "force update" code to avoid potential DOS
>attacks...
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/mozilla/bedrock/pull/1333/files#r7810107

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.