[Zope] Serve large files efficiently from a pipe

Roman Suzi rnd at onego.ru
Tue Nov 8 08:47:11 EST 2005


On Tue, 8 Nov 2005, Tino Wildenhain wrote:

> Roman Suzi schrieb:
>> 
>> Hi!
>> 
>> Newer Zope versions have an interesting ability to serve large files
>> efficiently given the file name ( 
>> http://plope.com/Members/chrism/ploneconf2004/2004pres.txt ).
>> 
>> What about serving large files given file(-like) handler? It could be
>> very beneficial sometimes, especially with dynamically generated
>> content...
>> 
>> Does Zope has anything for this?
>> 
>> Thank you for any ideas on this topic!
>
> Have a look at:
>
> http://www.dataflake.org/software/filecachemanager
>
> it implements what you are asking for.

Thank you for the link, however, it seems that it is not what I am looking 
for. I do not want the file contents be read into Python program as a whole 
but piped to the HTTP client. This piece of FileCacheManager code
give me doubts that this is how it works:


"""
cache_entry = FileCacheEntry(self, ob, fname, self._tempfile_path) 
cache_entry.write(data) 
"""

I want something which works similar to Unix pipe but for HTTP client:


this_generates_output | process_output >> http_client


I do not want to store it anywhere on the FS and/or ZODB! And I certainly do 
not want to read the resulting file as a Python string into RAM. So,
I cant understand how RAMCache or FILECacheManager is going to help me.

I don't know if writing to response one chunk at a time is proper 
solution? Will Zope store response body or sent it right away? I am not 
sure that it is the later...


> HTH
> Tino
>

Sincerely yours, Roman Suzi
-- 
rnd at onego.ru =\= My AI powered by GNU/Linux RedHat 7.3


More information about the Zope mailing list