On Wed, Dec 19, 2012 at 7:38 PM, Sergiu Dumitriu <sergiu(a)xwiki.org> wrote:
On 12/19/2012 01:33 PM, Paul Libbrecht wrote:
It's
not Velocity that's buffering, it's the whole rendering engine that
does that. Velocity itself is just one of the steps through which
document content passes, and each step outputs everything in a buffer
which is later flushed down the socket after every rendering step is
finished.
At least that's what's happening if you use the rendering engine to
"run" code from wiki documents.
Is there any way to disable buffering at each of the steps?
No, especially not with the current (XRendering) rendering engine, since
Velocity is just a Transformation that works on the XDOM, which will be
actually transformed into real output in a separate process that expects
a final, full DOM.
That's true but it does not prevent you to write directly in the response
if you want.
Something like:
## Get the response buffer/stream
#set($out = $response.outputStream())
## Write some content to the response buffer
$out.print("some content")
## Make sure everything is sent
$out.flush()
## Indicate XWiki that you already sent the answer
$xcontext.setFinished(true)
I'm
thinking this may have a performance impact.
Yes, it does.
However, for my case, implementing OAI-PMH,
I've solved it by using the
"query resumption" that the protocol
offers.
It's good that you found a workaround.
--
Sergiu Dumitriu
http://purl.org/net/sergiu
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Thomas Mortagne