On Wed, Oct 23, 2002 at 05:55:05PM -0500, Dave Rolsky wrote: > So here's the situation. > > I have some code that generates images dynamically. It works, mostly. > > Sometimes the image will show up as a broken image in the browser. If I > reload the page once or twice, the image comes up fine. > > On a page with 5 different dynamic images (all generated by the same chunk > of code, it's a set of graphs), I'll often see 1 or 2 as a broken image, > but the rest work. Sometimes all 5 are ok. > > I tried out a scheme of writing them to disk with dynamically generated > files, but since I still need to do some auth checking, they end up being > served dynamically and I have the same problem. > > To make it even weirder, I just took a look at one of the image files that > showed up as broken, and it's fine (I can't view it directly in my > browser).
I've seen the problem before. My solution was to save the dynamic images on disk and serve them just like plain 'ol static files from the front-end server. This way everything is served from the same "Keep-Alive" request. And apache does all the http/1.1 headers/chunked-encoding for me. Your MaxKeepAliveRequests would then be the culprit on your end but not likely unless its set really low. I'm not sure how the browser determines the equivalent limit. tcpdump showed that opera created a second keep-alive request after 10 images for me (could be limiting on bytes rather than requests ... don't know). You can still serve dynamicly and handle the custom auth w/ the backend and maintain the clients keep-alive. The current mod_proxy will maintain the clients keep-alive eventhough your backend has keepalive off. Be sure all the required http/1.1 components/headers are sent to maintain a keep-alive. I'm interested in what you finally work out. thanks, Ed