feat(cdn预热管理): 新增cdn预热管理改善文件访问性能

This commit is contained in:
2025-07-14 15:34:51 +08:00
parent 6f49139d34
commit 1ac365eeae
@@ -3,8 +3,6 @@ package com.central.file.service.impl;
import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient; import com.aliyuncs.IAcsClient;
import com.aliyuncs.cdn.model.v20180510.*; import com.aliyuncs.cdn.model.v20180510.*;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile; import com.aliyuncs.profile.DefaultProfile;
import com.central.file.config.CdnConfig; import com.central.file.config.CdnConfig;
import com.central.file.service.ICdnService; import com.central.file.service.ICdnService;
@@ -104,8 +102,8 @@ public class CdnServiceImpl implements ICdnService {
} }
PushObjectCacheResponse response = getAcsClient().getAcsResponse(request); PushObjectCacheResponse response = getAcsClient().getAcsResponse(request);
log.info("文件预热成功,任务ID: {}", response.getPushTaskId()); log.info("文件预热成功,任务ID: {}", response.getPreloadTaskId());
return response.getPushTaskId(); return response.getPreloadTaskId();
} catch (Exception e) { } catch (Exception e) {
log.error("文件预热失败", e); log.error("文件预热失败", e);
throw new RuntimeException("文件预热失败: " + e.getMessage()); throw new RuntimeException("文件预热失败: " + e.getMessage());