spring_reference/IX. ‘How-to’ guides/64.17.2. Enable HTTP respon...

650 B
Raw Permalink Blame History

64.17.2. 使用GzipFilter开启HTTP响应压缩

如果你正在使用Jetty或Undertow或想要更精确的控制HTTP响应压缩Spring Boot为Jetty的GzipFilter提供自动配置。虽然该过滤器是Jetty的一部分但它也兼容Tomcat和Undertow。想要启用该过滤器只需简单的为你的应用添加org.eclipse.jetty:jetty-servlets依赖。

GzipFilter可以使用spring.http.gzip.*属性进行配置。具体参考GzipFilterProperties