0

Spring Controller Method annotated with @ResponseBody takes long time to generate JSON response when I annotate it with @GET HTTP Method annotation

While the same method when annotated with @POST (keeping @ResponseBody annotation intact), the JSON response is generated quickly.

MappingJackson2HttpMessageConverter is configured in our application along with RequestMappingHandlerAdapter.

I can say that response generation is taking time since after returning from the controller method, the call back on JavaScript Ajax request takes longer to get called when @GET is used on method as compared to when @POST is used on method.

Can someone please help me understand what is taking time.

Or any help in understanding what all spring interceptors/handlers are getting called in response generation, will be greatly appreciated.

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
Amit Dube
  • 947
  • 4
  • 10
  • 23
  • I wouldn't expect `@Get` and `@Post` to influence the behavior as those are JAX-RS annotations and not spring annotations. So either you aren't using Spring MVC, or are doing some weird things. – M. Deinum Feb 15 '16 at 14:07
  • Are you using any custom filters? – jstuartmilne Feb 15 '16 at 14:08
  • Yes, we are using Custom Filters for GZiping all the content of a GET Request. Thanks alot, for bringing my attention towards that. – Amit Dube Feb 15 '16 at 14:23

0 Answers0