On Thu, 2009-09-17 at 16:35 -0700, mediumgrade wrote:
> I have several views which generate some JSON data. They all end
> something like this:
> 
> response = HttpResponse(pie_data, mimetype='application/json')
> response['Content-Disposition'] = 'attachment;
> filename=my_pie_chart.json'
> 
> Where "pie_data" is holding some generated JSON data that I wish to
> send back to my application. However, Internet Explorer keeps caching
> this data which is messing up the JavaScript components that are
> actually using it. Is there something I can inject in the HTTP header
> to prevent IE from caching the data? Neither Firefox nor Chrome seems
> to exhibit this behavior.
> 
> Any help would be appreciated. Thank you so much.


        from django.views.decorators.cache import never_cache
        
        @never_cache
        def yourview(request):
          ...
        
See
http://docs.djangoproject.com/en/dev/topics/cache/#controlling-cache-using-other-headers


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to