Class: TencentCloud::Ecdn::V20191012::Cache

Inherits:
Common::AbstractModel
  • Object
show all
Defined in:
lib/v20191012/models.rb

Overview

缓存配置简单版本,该版本不支持设置源站未返回max-age情况下的缓存规则。

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cacherules = nil, followorigin = nil) ⇒ Cache

Returns a new instance of Cache.



84
85
86
87
# File 'lib/v20191012/models.rb', line 84

def initialize(cacherules=nil, followorigin=nil)
  @CacheRules = cacherules
  @FollowOrigin = followorigin
end

Instance Attribute Details

#CacheRulesObject

on:开启off:关闭开启后,未能匹配 CacheRules 规则的资源将根据源站返回的 max-age 值进行节点缓存;匹配了 CacheRules 规则的资源将按照 CacheRules 中设置的缓存过期时间在节点进行缓存注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • CacheRules:

    缓存配置规则数组。

  • FollowOrigin:

    遵循源站 Cache-Control: max-age 配置,白名单功能。



82
83
84
# File 'lib/v20191012/models.rb', line 82

def CacheRules
  @CacheRules
end

#FollowOriginObject

on:开启off:关闭开启后,未能匹配 CacheRules 规则的资源将根据源站返回的 max-age 值进行节点缓存;匹配了 CacheRules 规则的资源将按照 CacheRules 中设置的缓存过期时间在节点进行缓存注意:此字段可能返回 null,表示取不到有效值。

Parameters:

  • CacheRules:

    缓存配置规则数组。

  • FollowOrigin:

    遵循源站 Cache-Control: max-age 配置,白名单功能。



82
83
84
# File 'lib/v20191012/models.rb', line 82

def FollowOrigin
  @FollowOrigin
end

Instance Method Details

#deserialize(params) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
# File 'lib/v20191012/models.rb', line 89

def deserialize(params)
  unless params['CacheRules'].nil?
    @CacheRules = []
    params['CacheRules'].each do |i|
      cacherule_tmp = CacheRule.new
      cacherule_tmp.deserialize(i)
      @CacheRules << cacherule_tmp
    end
  end
  @FollowOrigin = params['FollowOrigin']
end