/**
* 功能描述: 通过max-age设置CDN缓存<br>
*
* @param response
* @param cacheMinute 缓存时间
* @see [相关类/方法](可选)
* @since [产品/模块版本](可选)
*/
public void setCache(HttpServletResponse response, String cdnCacheTime) {
// 默认打开(0---打开;1---关闭)
String on_off_val = "0";
if ("0".equals(on_off_val)) {
long now = System.currentTimeMillis();
long cacheTimeLong = Long.parseLong(cdnCacheTime) * 1000;
long temTime = cacheTimeLong == 0 ? now : (now - (now % cacheTimeLong));
response.setDateHeader("Expires", now + cacheTimeLong);
response.setDateHeader("Last-Modified", temTime);
response.setHeader("Cache-Control", "max-age=" + cdnCacheTime);
response.setHeader("Pragma", "Pragma");
}
}