cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] HowTos Litrik Main ServingLargeFiles Tue Dec 23 22:00:05 2003
Date Tue, 23 Dec 2003 21:00:05 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=HowTos , version: 154 on Tue Dec 23 20:11:01
2003 by 81.241.41.222

+ 
+ * __[Serving Large Files]__ -- how to serve really large files - [Litrik]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=Litrik , version: 2 on Tue Dec 23 21:06:19 2003
by Litrik

- * I work at [Inventive Designers|http://www.inventivedesigners.com/] where I am responsible
for the website (among other things).
+ I work at [Inventive Designers|http://www.inventivedesigners.com/] where I am responsible
for the website (among other things). Inventive Designers' website is built completely using
Cocoon 2.1 and does the following things:
+ * Retrieve and display live data from Lotus Domino.
+ * Protect sections for customers and partners
+ * Execute iSeries (AS/400) code based on information entered on a form.
+ * Generate multiple download pages on-the-fly using the DirectoryGenerator
+ * [Serving Large Files]: +100MB
+ * Generate a photo album on-the-fly using the ImageDirectoryGenerator
+ 
+ The following websites are also generated by Cocoon, but crawled and served as static pages:
+ * [Rolmite|http://www.rolmite.org]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=Main , version: 315 on Tue Dec 23 20:49:35 2003
by Litrik

+ * December 23, 2003
+ ** [Serving Large Files] -- [Litrik]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=ServingLargeFiles , version: 1 on Tue Dec 23
20:47:43 2003 by Litrik

New page created:
+ !!Serving Large Files
+ 
+ The following tips are useful when serving really large files (let's say 100MB).
+ 
+ If you don't want to read all of this stuff... there's an example at the bottom of this
page, ready to be copy/pasted ;-)
+ 
+ !Disable Caching
+ 
+ You don't want to waste your precious cache space on a 100MB file.
+ 
+ To disable caching add the following attribute to your pipeline:
+ {{{
+ type="noncaching"
+ }}}
+ 
+ Details about enabling/disabling caching can be found on in the [official documentation|http://cocoon.apache.org/2.1/userdocs/concepts/caching.html#How+to+Configure+Caching].
+ 
+ !Disable Response Buffering
+ 
+ ''Each pipeline can buffer the response, before it is send to the client. The default buffer
size is unlimited (-1), which means when all bytes of the response are available on the server,
they are send with one command directly to the client. Of course, this slows down the response
as the whole response is first buffered inside Cocoon and then send to the client instead
of directly sending the parts of the response when they are available.''
+ 
+ So, by default, the whole file is loaded in memory before being sent to the client. This
is __very bad__ and will quickly lead to OutOfMemory errors. 
+ 
+ To disable response buffering add the following child element to your pipeline:
+ {{{
+ <map:parameter name="outputBufferSize" value="0"/>
+ }}}
+ 
+ Details about response buffering can be found on in the [official documentation|http://cocoon.apache.org/2.1/userdocs/concepts/caching.html#Configuration+of+Pipelines].
+ 
+ !Support byteranges/resumes
+ 
+ Older versions of Cocoon (2.0.x) had a ByteRangeResourceReader in the scratchpad. This component
implemented byterange support which allows clients (browsers or download managers) to resume
broken downloads. Since 2.1.x this code was merged into the regular ResourceReader, however
that code is buggy.
+ 
+ A [bug report and patch|http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25712] have been
added to BugZilla. It has not yet been committed to CVS.
+ 
+ !Full Example
+ {{{
+ <map:pipeline type="noncaching">
+   <map:parameter name="outputBufferSize" value="0"/>
+   <map:match pattern="**.zip">
+     <map:read src="{1}.zip" mime-type="application/octet-stream"/>
+   </map:match>
+ </map:pipeline>
+ }}}
+ 



Mime
View raw message