Edit CDN Resource

Patchhttps://api.cdn77.com/v3/cdn/{id}

Request parameters

  • idinteger in pathrequired

Request body≥1 required

  • cacheobject

    Your files will remain cached for the specified duration, after which your origin will be checked for an updated version of your files. Expiry/cache-control headers override this setting.

  • cnamesarray of strings

    All CNAMEs should be mapped via DNS to CDN URL. Otherwise it's not possible to generate SSL certificate.Maximum number of CNAMEs is "10". To add more, contact our support.

  • geo_protectionobject

    Geo protection enables you to control which countries can access your content directly.

  • headersobject
  • hotlink_protectionobject

    Hotlink protection enables you to control which hostnames/domains can link to and access your content directly.

  • https_redirectobject

    If enabled, all requests via HTTP are redirected to HTTPS. Verify HTTPS availability of CNAMEs before activating, if applicable.

  • ip_protectionobject

    IP protection enables you to control which networks can access your content directly.

  • labelstring

    The label helps you to identify your CDN Resource.

  • notestring

    Optional note for the CDN Resource.

  • mp4_pseudo_streamingobject

    Turn this option on if using a flash-based video player with MP4 files. Pseudo-streaming is used mainly in flash players. HTML5 players use range-requests. When enabled the "query_string" option must be set to ignore all parameters.

  • origin_idstring

    ID of attached Origin (content source for CDN Resource). More information in our Origin API documentation.

  • origin_headersobject
  • query_stringobject

    Enabling this feature will ignore the query string, allowing URLs with query strings to cache properly. This is particularly useful if you tag your URLs with tracking/marketing parameters, for example.

  • rate_limitobject

    When enabled, this feature limits the data transfer rate by setting "limit_rate" based on the "rs" URL parameter and "limit_rate_after" by the value from the "ri" URL parameter.

  • secure_tokenobject

    This feature allows you to serve your content using signed URLs. You can enable your users to download secured content from the CDN Resource with a valid hash. Note: When you check this option, make sure to generate secured links to access your content. Maximum length is 64 characters.

  • sslobject
  • wafobject

    Protect your website against XSS, SQL injection and more with our SmartWAF. We're using OWASP Core Rule Set (CRS) to protect your data against the most exploited vulnerabilities.

Example of the request body
{
  "cache": {
    "max_age": 1440,
    "max_age_404": 1,
    "requests_with_cookies_enabled": true
  },
  "cnames": [
    "cname.your-domain.com"
  ],
  "geo_protection": {
    "countries": [
      "UK"
    ],
    "type": "passlist"
  },
  "headers": {
    "cors_enabled": true,
    "cors_timing_enabled": true,
    "cors_wildcard_enabled": true,
    "host_header_forwarding_enabled": true,
    "content_disposition": {
      "type": "parameter"
    }
  },
  "hotlink_protection": {
    "domains": [
      "some-domain.com"
    ],
    "type": "passlist",
    "empty_referer_denied": true
  },
  "https_redirect": {
    "code": 301,
    "enabled": true
  },
  "ip_protection": {
    "ips": [
      "8.8.8.8"
    ],
    "type": "passlist"
  },
  "label": "My cdn",
  "note": "Note for my CDN",
  "mp4_pseudo_streaming": {
    "enabled": true
  },
  "origin_id": "e56564d1-8d3e-4457-93a6-082b054bc736",
  "origin_headers": {
    "custom": {
      "additionalProp1": "default-src 'self' *.example.com; img-src *",
      "additionalProp2": "default-src 'self' *.example.com; img-src *",
      "additionalProp3": "default-src 'self' *.example.com; img-src *"
    }
  },
  "query_string": {
    "parameters": [
      "utm"
    ],
    "ignore_type": "all"
  },
  "rate_limit": {
    "enabled": false
  },
  "secure_token": {
    "token": "2Xod4tW8Ln4BDg23",
    "type": "parameter"
  },
  "ssl": {
    "type": "SNI",
    "ssl_id": "9880280c-0507-46d1-88f3-71cfee83fa57"
  },
  "waf": {
    "enabled": true
  }
}

Responses

CDN Resource details were edited.

Can’t find what you are looking for?