Flushing early in Coldbox layout

So that makes for an interesting problem for CB then.

I actually do the same thing in one of my applications. Certain viewlets in
my app are generated using cfhttp, cfdocument and cfimage, and they can take
a while to be rendered. I use caching heavily, both using nginx as a front
end web cache and CacheBox. However obviously the requests are not *always*
cached, and making any user wait over a minute for the entire page was
totally unacceptable(!)

By requesting the viewlets using ajax, this rectified this issue (I couldn't
find a good way to use CFFLUSH with ColdBox). Ok, so the viewlets do take up
to a minute occasionally to appear (for one request in every 10,000 or so)
but users tend not to notice until an extra part of the page "suddenly
appears". Due to the heavy caching, the extra ajax requests are not any
worse than requesting an additional image or two, so end-user performance is
hardly effected.

If you do find a way to get cfflush working, it would be better - and I'd
love to hear it! :slight_smile:

Having said that, when using ajax, the fact the "blue bar" in IE stops and
there are no egg-timers (as it appears everything HAS loaded) is quite
appealing in itself....

Tom.

I have been thinking about this some…

See what you think…

Using an interceptor to postprocess or postrender, you could potentially throw this into a continuous loop, at least until you tell it is finished with what you need.

That means you get to deliver a basic layout, and then could continue to deliver the content in a flush type scenario until the content you want to deliver is complete.

You could use the preprocess or the prerender to then add what content you want, that will be needed to be flushed at the end.

This could be a good starting point in getting something up and running, any thoughts.