Home › Docs › CDPCDN – Access

Docs

CDPCDN – Access

CDPCDN has a public side –
the addresses that browsers load –
and a managed side, where zones are configured and files are uploaded.
This page lists every real way of access and the authentication that applies to it.

Note on the examples: <CDN_HOST>, <DRIVE_HOST> and <STORAGE_HOST> stand for the host names of your own installation, e.g. cdn.example.com, drive.example.com and storage.example.com;
<ZONE> is the zone name (normally the project or bucket name).

Public CDN addresses

Delivery needs no sign-in, no key and no signature.
Anyone who knows an address can load the file.
All addresses use HTTPS on port 443.

FormAddressBrowser cache
Plain addresshttps://<CDN_HOST>/<ZONE>/<folder>/<file>1 day (or less if the zone cache time is shorter)
Image sizehttps://<CDN_HOST>/<ZONE>/<folder>/<name>-<width>.<format>1 day
Versioned addresshttps://<CDN_HOST>/<ZONE>/<folder>/<version>/<file>zone cache time (default 1 year), immutable
Own domain (alias host)https://cdn.example.com/<folder>/<file>as above

The version code consists of 8 hexadecimal characters and changes with every new upload of the file.
Image sizes work only for the widths configured in the zone and only for raster sources (JPG, JPEG, PNG, WebP, GIF, AVIF, BMP).
For a size address the CDN looks for the source with the same name and one of these extensions in the same folder.

Responses carry the correct content type, Access-Control-Allow-Origin: * and X-Content-Type-Options: nosniff;
no cookies are set.

Management in the web interface

Zones are managed on https://<DRIVE_HOST> under Delivery.
This page and the project settings are reserved for administrators;
sign-in uses the user account of CDPDrive with password and, for administrators, a one-time code (TOTP).
Members of a project see the CDN addresses of its files in the Button Use of the file browser and in the preview, but cannot change zones.
The Drive module must be switched on to reach the web interface.

Uploading files for delivery

CDPCDN itself has no upload interface;
files of project zones come from the project:

  • File browser of CDPDrive: drag & drop or upload Button; large files are sent in 5 MB parts.
  • S3 API of CDPStorage: endpoint https://<STORAGE_HOST>, path-style addressing, Signature V4, any region string (e.g. eu-fra), access key and secret from the page "Access keys (S3)".

Example with a generic S3 command-line client (path-style must be enabled in its configuration):

export AWS_ACCESS_KEY_ID=<ACCESS_KEY>
export AWS_SECRET_ACCESS_KEY=<SECRET_KEY>
aws configure set default.s3.addressing_style path
aws s3 cp chair.jpg s3://<BUCKET>/products/chair.jpg \
    --endpoint-url https://<STORAGE_HOST> --region eu-fra

The file is then reachable as https://<CDN_HOST>/<BUCKET>/products/chair.jpg, because the zone of a project carries the bucket name.

JSON API and media picker

For signed-in users the web interface offers GET https://<DRIVE_HOST>/api/v1/projects/<PROJECT_ID>/objects (session sign-in) and the media picker /picker.
Both return, for each file of a project with CDN delivery, the original address, the size addresses, the versioned address and the srcset string.
<PROJECT_ID> is the number of the project in the address of its page in CDPDrive (https://<DRIVE_HOST>/projects/<PROJECT_ID>), not the bucket name.

CDPCMS helpers

With the CDPCMS module CDPDrive, templates call cdpdrive_url('products/chair.png') and cdpdrive_srcset('products/chair.png').
The module stores the access key encrypted and talks to the S3 API with its own client.

Same-domain delivery on the server

For websites operated on the same server, an nginx snippet can deliver /core/assets/ under the website's own domain: local files are served first, missing ones are fetched from the CDPCDN zone and kept in a shared server cache (2 GB, 30 days).
The response header X-CDP-Cache shows whether the file came from that cache.
This is a server configuration, not a setting in the web interface.