You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Èëüÿ <at...@gmail.com> on 2006/03/13 12:16:04 UTC
Re[2]: Fast response, using valves
Well, I don't think so.
1. The benchmark tool was taken from this site:
http://www.caucho.com/articles/jsp_benchmark.xtp it's written in C and
doesn't seem to understand caching.
2. Nothing changed after I added following lines to my servlet
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
Any more ideas?
Ilya.
David wrote:
--------------------------------------------------------------------------------
Perhaps because, in the version without valve, you benchmarking tool use
the expected behaviour of browsers when they have an active cache:
request 'if-modified-since', to which tomcat will respond a 'not modified'.
Rumata a écrit :
>Hello.
>
>I'm trying to make Tomcat server response to some kind of request as
>fast as possible. As far as I understood I can stop processing of
>request using a valve registered in the Engine pipeline.
>
>I wrote the following code:
>public class testValve extends org.apache.catalina.valves.ValveBase {
> public void invoke(Request request, Response response) throws IOException, ServletException {
> if (request.getRequestURI().equals("/testValve/hello_java")) {
> response.getOutputStream().print("<html><body>Hello All!<br>Rumata</body></html>");
> response.sendAcknowledgement();
> response.finishResponse();
> response.flushBuffer();
> return;
> }
>
> getNext().invoke(request, response);
> }
>}
>
>and registered this valve in engine section.
>
>I also wrote a sample servlet with the same output.
>
>Now I'm trying to benchmark the whole thing and I get strange results:
>valve is slower than the servlet!
>
>Where I am mistaken?
>
>Thanks,
>Ilya.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org