On Wed, Feb 10, 2010 at 7:24 PM, Forest Bond <for...@alittletooquiet.net> wrote:
> Hi,
>
> On Wed, Feb 10, 2010 at 11:09:29AM -0800, mrts wrote:
>> You don't need that fix to use efficient file serving.
>>
>> Just use an empty response and set the X-Sendfile header manually if
>> using
>> Apache. If not, check your server documentation for the right header
>> name.
>>
>> E.g.:
>>
>> response = HttpResponse()
>> response['X-Sendfile'] = '/full/path/to/file'
>> response['Content-Type'] = 'some/content_type'
>> response['Content-Length'] = os.stat('/full/path/to/file').st_size
>> response['Content-Disposition'] = 'attachment; filename="foo"'
>> return response
>
> This only works for use cases where you have an on-disk file to serve.  There
> are plenty of situations where this may not be the case:
>
> * Cloud storage services (e.g. Rackspace Cloud Files)
> * Large data sets (e.g. data exports to CSV, XML)
>
> Etc.
>
> Thanks,
> Forest

In the majority of our cases, we are normally building a 'regular'
HTML page, but often one page will require 1000s of web service calls
to other services. We use iterator based responses to eke out a
response without it timing out.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to