zoukankan      html  css  js  c++  java
  • jersey 开启gzip

     1     @Bean
     2     public ResourceConfig resourceConfig() {
     3         ResourceConfig resourceConfig = new ResourceConfig();
     4 
     5         // 开启gzip压缩支持请求
     6         resourceConfig.register(GZipEncoder.class);
     7         // 开启gzip压缩支持响应(依赖的包:org.glassfish.jersey.ext:jersey-entity-filtering:2.27)
     8         resourceConfig.register(EntityFilteringFeature.class);
     9         EncodingFilter.enableFor(resourceConfig, GZipEncoder.class);
    10 
    11         return resourceConfig;
    12     }
    <dependency>
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-entity-filtering</artifactId>
            <version>2.27</version>
    </dependency>
  • 相关阅读:
    such用法
    divorce用法
    towel用法
    go for用法
    catch on用法
    incredibly用法
    mess用法
    dentist用法
    steer clear of用法
    incredible
  • 原文地址:https://www.cnblogs.com/boazy/p/10497611.html
Copyright © 2011-2022 走看看