public class SimpleCache extends AbstractModel
header, skipSign| Constructor and Description | 
|---|
| SimpleCache() | 
| SimpleCache(SimpleCache source)NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. | 
| Modifier and Type | Method and Description | 
|---|---|
| SimpleCacheRule[] | getCacheRules()Get 缓存过期时间规则
注意:此字段可能返回 null,表示取不到有效值。 | 
| String | getCompareMaxAge()Get 高级缓存过期配置,开启时会对比源站返回的 max-age 值与 CacheRules 中设置的缓存过期时间,取最小值在节点进行缓存
on:开启
off:关闭
默认为关闭状态
注意:此字段可能返回 null,表示取不到有效值。 | 
| String | getFollowOrigin()Get 遵循源站 Cache-Control: max-age 配置
on:开启
off:关闭
开启后,未能匹配 CacheRules 规则的资源将根据源站返回的 max-age 值进行节点缓存;匹配了 CacheRules 规则的资源将按照 CacheRules 中设置的缓存过期时间在节点进行缓存
与 CompareMaxAge 冲突,不能同时开启
注意:此字段可能返回 null,表示取不到有效值。 | 
| String | getIgnoreCacheControl()Get 强制缓存
on:开启
off:关闭
默认为关闭状态,开启后,源站返回的 no-store、no-cache 资源,也将按照 CacheRules 规则进行缓存
注意:此字段可能返回 null,表示取不到有效值。 | 
| String | getIgnoreSetCookie()Get 忽略源站的Set-Cookie头部
on:开启
off:关闭
默认为关闭状态
注意:此字段可能返回 null,表示取不到有效值。 | 
| Revalidate | getRevalidate()Get 总是回源站校验
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setCacheRules(SimpleCacheRule[] CacheRules)Set 缓存过期时间规则
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setCompareMaxAge(String CompareMaxAge)Set 高级缓存过期配置,开启时会对比源站返回的 max-age 值与 CacheRules 中设置的缓存过期时间,取最小值在节点进行缓存
on:开启
off:关闭
默认为关闭状态
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setFollowOrigin(String FollowOrigin)Set 遵循源站 Cache-Control: max-age 配置
on:开启
off:关闭
开启后,未能匹配 CacheRules 规则的资源将根据源站返回的 max-age 值进行节点缓存;匹配了 CacheRules 规则的资源将按照 CacheRules 中设置的缓存过期时间在节点进行缓存
与 CompareMaxAge 冲突,不能同时开启
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setIgnoreCacheControl(String IgnoreCacheControl)Set 强制缓存
on:开启
off:关闭
默认为关闭状态,开启后,源站返回的 no-store、no-cache 资源,也将按照 CacheRules 规则进行缓存
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setIgnoreSetCookie(String IgnoreSetCookie)Set 忽略源站的Set-Cookie头部
on:开启
off:关闭
默认为关闭状态
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setRevalidate(Revalidate Revalidate)Set 总是回源站校验
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | toMap(HashMap<String,String> map,
     String prefix)Internal implementation, normal users should not use it. | 
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, isStream, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonStringpublic SimpleCache()
public SimpleCache(SimpleCache source)
public SimpleCacheRule[] getCacheRules()
public void setCacheRules(SimpleCacheRule[] CacheRules)
CacheRules - 缓存过期时间规则
注意:此字段可能返回 null,表示取不到有效值。public String getFollowOrigin()
public void setFollowOrigin(String FollowOrigin)
FollowOrigin - 遵循源站 Cache-Control: max-age 配置
on:开启
off:关闭
开启后,未能匹配 CacheRules 规则的资源将根据源站返回的 max-age 值进行节点缓存;匹配了 CacheRules 规则的资源将按照 CacheRules 中设置的缓存过期时间在节点进行缓存
与 CompareMaxAge 冲突,不能同时开启
注意:此字段可能返回 null,表示取不到有效值。public String getIgnoreCacheControl()
public void setIgnoreCacheControl(String IgnoreCacheControl)
IgnoreCacheControl - 强制缓存
on:开启
off:关闭
默认为关闭状态,开启后,源站返回的 no-store、no-cache 资源,也将按照 CacheRules 规则进行缓存
注意:此字段可能返回 null,表示取不到有效值。public String getIgnoreSetCookie()
public void setIgnoreSetCookie(String IgnoreSetCookie)
IgnoreSetCookie - 忽略源站的Set-Cookie头部
on:开启
off:关闭
默认为关闭状态
注意:此字段可能返回 null,表示取不到有效值。public String getCompareMaxAge()
public void setCompareMaxAge(String CompareMaxAge)
CompareMaxAge - 高级缓存过期配置,开启时会对比源站返回的 max-age 值与 CacheRules 中设置的缓存过期时间,取最小值在节点进行缓存
on:开启
off:关闭
默认为关闭状态
注意:此字段可能返回 null,表示取不到有效值。public Revalidate getRevalidate()
public void setRevalidate(Revalidate Revalidate)
Revalidate - 总是回源站校验
注意:此字段可能返回 null,表示取不到有效值。Copyright © 2025. All rights reserved.