> From: markw () dolphtech ! com > Subject: performance of serving static data? apache or tomcat > > I am working on a servlet that will be served from tomcat which is > connected to apache. Currently I have the servlet being handled by > tomcat, and the image handled by apache. > Won't this require 2 get requests by the browser? One being the image, > and one being the servlet?
Think of the simple case -- a static page with an image. The client will request the page, then issue a request for the image. If the client understands HTTP/1.1 and you have enabled KeepAlives on the server, then the client should pipeline the two requests using the same socket connection. If apache is routing the requests to tomcat, you should have no problem; the requests can still be pipelined. This is pretty easy to check with a telnet client. (Let's call your host www.example.com, with /servlets/A as a servlet, and /B.txt as a static file). $ telnet www.example.com 80 [a few lines come back] GET /servlets/A HTTP/1.1 Host: www.example.com [output from /servlets/A appears here] GET /B.txt HTTP/1.1 Host: www.example.com [content of B.txt appears here] ^] telnet> quit Connection closed. Be sure to put a blank line after Host:, but no blank line before GET. Image files are messy as telnet output, but if the above works with a static text file, it should also work with a static image file. If you want to try it with https, you can use the openssl command line utility. $ openssl s_client -connect www.example.com:443 [rest is same as above] -- Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
