terraform-provider-tencentcloud icon indicating copy to clipboard operation
terraform-provider-tencentcloud copied to clipboard

tencentcloud_cdn_domain add support for cache configuration

Open jossy opened this issue 4 years ago • 3 comments

For every non-trivial CDN distribution is seems essential that it's possible to configure caching rules. Is there any ETA when we can expect support for that?

jossy avatar Dec 04 '20 18:12 jossy

Hi, @jossy We have arranged a special version mainly to solve CDN issue (this cache rule feature is included), and it is expected to support in January

gailwang avatar Dec 10 '20 07:12 gailwang

@jossy the latest version(1.53.0) has supported rule_cache parameter. You can have a try with it, see if it meets the needs

gailwang avatar Jan 15 '21 12:01 gailwang

@gailwang Support for this is a huge improvement, thank you!

However, I think cache_time shouldn't be a required setting. There are rules like this here, where a TTL doesn't make sense and can't even be configured in the UI:

tencent_cache_rules

In order to achieve the same result with the Terraform provider cache_time needs to be set to 2592000 which is IMHO very confusing. I can see that this number is returned by the API, but maybe it should be a default value then?

Currently, you have to do the following to come to the same result:

rule_cache {
  cache_time      = 2592000
  no_cache_switch = "on"
  rule_paths      = ["no max-age"]
  rule_type       = "default"
}
rule_cache {
  cache_time           = 2592000
  follow_origin_switch = "on"
  rule_paths           = ["*"]
  rule_type            = "all"
}

jossy avatar Feb 16 '21 10:02 jossy