2 Replies Latest reply: Jan 4, 2013 10:11 AM by Gautam Singh RSS

    Bypassing servlet pipeline for requests

    dominiclovell
      I'd like to remove some overhead on some of our requests, mostly the ajax requests that are doing some utility functions, or just sending metrics to our server.

      I've profiled our code and can see these requests have a bottleneck at the HeadPipelineServlet (i.e. servlet pipeline).

      Is there any way we can bypass certain steps for these requests, and remove some of the overhead. Lots of the steps in the daf pipeline aren't necessary for these.

      We are on 9.4.
        • 1. Re: Bypassing servlet pipeline for requests
          dominiclovell
          No replies? Awesome.
          • 2. Re: Bypassing servlet pipeline for requests
            Gautam Singh
            If you want to disable a pipeline servlet all together you can set the enable property of the pipeline servlet component to false.
            If you want to disable it for certain request I can't think of any configuration to accomplish this.
            One way is to extend the pipeline class and skip the whole logic based on request uri
            You code will be something like this:
            public class MyHeadPipelineServlet extends HeadPipelineServlet
            {
                 public void service( DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse ) throws IOException, ServletException
                 {
                      if ( isEnabled() )
                      {
                 if( !pRequest.getRequestURI().startsWith( "/ajax" ) )
                           {
                                super.service( pRequest, pResponse );
                           }
            }
            }
            }

            Configure HeadPipelineServlet to use your class.