高级设置接口
所有文档

          内容分发网络 CDN

          高级设置接口

          设置HttpHeader

            public void setDomainHttpHeader(CdnClient client, String domainName) {
                  HttpHeader header1 = new HttpHeader().withType("origin").withHeader("x-auth-cn")
                          .withValue("xxxxxxxxx").withAction("add");
                  HttpHeader header2 = new HttpHeader().withType("response").withHeader("content-type")
                          .withValue("application/octet-stream").withAction("add");
                  client.setDomainHttpHeader(new SetDomainHttpHeaderRequest().withDomain(domainName)
                          .addHttpHeader(header1).addHttpHeader(header2));
              }

          查询HttpHeader

           public void getDomainHttpHeader(CdnClient client, String domainName) {
                  GetDomainHttpHeaderResponse response = client.getDomainHttpHeader(domainName);
              }

          设置SEO开关属性

          public void setDomainSeoSwitch(CdnClient client, String domainName) {
                  SeoSwitch seoSwitch = new SeoSwitch()
                          .withDiretlyOrigin("ON").withPushRecord("OFF");
                  client.setDomainSeoSwitch(new SetDomainSeoSwitchRequest()
                          .withDomain(domainName).withSeoSwitch(seoSwitch));
              }

          查询SEO开关属性

           public void getDomainSeoSwitch(CdnClient client, String domainName) {
                  GetDomainSeoSwitchResponse response = client.getDomainSeoSwitch(domainName);
              }

          设置页面优化

           public void setDomainFileTrim(CdnClient client, String domainName) {
                  client.setDomainFileTrim(domainName, true);
              }

          查询页面优化

           public void getDomainFileTrim(CdnClient client, String domainName) {
                  GetDomainFileTrimResponse response = client.getDomainFileTrim(domainName);
              }

          设置视频拖拽

          public void setDomainMediaDrag(CdnClient client, String domainName) {
                  MediaDragConf mediaDragConf = new MediaDragConf();
                  MediaDrag mp4 = new MediaDrag().addFileSuffix("mp4").addFileSuffix("m4a")
                          .withStartArgName("startIndex").withDragMode("second");
                  MediaDrag flv = new MediaDrag().withDragMode("byteAV");
          
                  client.setDomainMediaDrag(new SetDomainMediaDragRequest()
                          .withDomain(domainName)
                          .withMediaDragConf(mediaDragConf.withMp4(mp4).withFlv(flv)));
              }

          查询视频拖拽

           public void getDomainMediaGrag(CdnClient client, String domainName) {
                  GetMediaDragResponse response = client.getMediaDrag(domainName);
                  
              }

          设置页面压缩

          public void setDomainCompress(CdnClient client, String domainName) {
                 Compress compress = new Compress().withAllow(true).withType("br");
                 client.setDomainCompress(new SetDomainCompressRequest()
                          .withDomain(domainName).withCompress(compress));
              }

          查询页面压缩

          public void getDomainCompress(CdnClient client, String domainName){
                  GetDomainCompressResponse response = client.getDomainCompress(domainName);
              }

          设置IPv6开关

          public void setDomainIPv6Dispatch(CdnClient client, String domainName) {
                  Enable enable = new Enable().withEnable(true);
                  client.setDomainIPv6Dispatch(domainName, new SetDomainIPv6DispatchRequest().withIPv6Dispatch(enable));
              }

          查询IPv6开关

          public void getDomainIPv6Dispatch(CdnClient client, String domainName) {
                  GetDomainIPv6DispatchResponse response = client.getDomainIPv6Dispatch(domainName);
              }

          设置QUIC开关

          public void setDomainQUIC(CdnClient client, String domainName) {
                  client.setDomainQUICSwitch(domainName, new SetDomainQUICRequest().withQUIC(true));
              }

          查询QUIC开关

          public void getDomainQUICSwitch(CdnClient client, String domainName) {
                  GetDomainQUICSwitchResponse response = client.getDomainQUICSwitch(domainName);
              }

          设置离线模式

          public void setDomainOfflineMode(CdnClient client, String domainName) {
                  client.setDomainOfflineModeSwitch(domainName, new SetDomainOfflineModeRequest().withOfflineMode(true));
              }

          查询离线模式

          public void getDomainOfflineMode(CdnClient client, String domainName) {
                  GetDomainOfflineModeSwitchResponse response = client.getDomainOfflineModeSwitch(domainName);
              }
          上一篇
          证书关联操作
          下一篇
          HTTPS相关接口