Does not work on annotated methods other than @ResponseBody. Am I misunderstanding something? What could be the main reason?
Compression applied to the @ResponseBody method:
@RequestMapping(value = "/property/{id}/pano.xml", method = RequestMethod.GET, produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody
public String getPanoXml(@PathVariable("id") Property property) {
return assetsProvider.loadUnderlyingObject(property.getPanoXml()).getObject();
}

Compression does not apply to the non @ResponseBody method:
@RequestMapping(value = "/property/{id}", method = RequestMethod.GET)
public String get(Model model, @PathVariable Long id, Locale locale) throws NoSuchRequestHandlingMethodException {
LocalizedProperty lp = repository.findProperty(id, locale.getLanguage());
if (lp == null)
throw new NoSuchRequestHandlingMethodException("get", PropertiesController.class);
model.addAttribute(lp);
return "property/show";
}

Lib and Config versions:
Spring Boot Version: 1.2.4.RELEASE
View Renderer: Thymeleaf
App config:
server:
tomcat:
compression: "1024"
compressableMimeTypes: "application/json,application/xml,text/html,text/xml,text/plain"
source
share