Home › Docs › CDPCDN – Guides

Docs

CDPCDN – Guides

These guides cover the everyday tasks with CDPCDN.
Each one uses only functions that exist in the current version.

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).

Configure image sizes per zone

  1. Open Delivery and expand the zone.
  2. Enter up to 8 widths in Widths (px, comma-separated, max. 8), each between 16 and 8192, e.g. 320, 640, 1280, 1920.
  3. Choose the Format (WebP, AVIF, JPG or PNG) and the Quality (30–100).
  4. Click Save, then Clear delivery files so that sizes built with the old settings are removed.

Sizes are scaled with bicubic resampling, EXIF orientation is applied, metadata is removed and transparency is kept.
AVIF works only if the PHP image library of the server supports it;
otherwise the original is delivered.

Use cache-busting with versioned addresses

Plain addresses are cached by browsers for one day and are replaced on the server as soon as you upload, rename or delete the file.
If a change must be visible immediately, use the versioned address from the dialog "Use this file": https://<CDN_HOST>/<ZONE>/css/<version>/site.css.
After a new upload the version code changes, so the page must reference the new address;
the versioned address is cached for the zone cache time and marked immutable.

Deliver an existing website with origin pull

  1. Delivery → New zone → Advanced: pull files from an external website (origin pull).
  2. Zone name: 3–63 characters following the bucket naming rules, not yet used. Origin website: e.g. https://www.example.com.
  3. Optional: restrict Allowed file types. Default: jpg, jpeg, png, webp, gif, svg, pdf, css, js, woff2, woff, ttf, mp4, ico.
  4. Open the zone page and use Scan page: it reads one page of the origin and lists images, stylesheets, scripts, fonts and icons with their CDN addresses (up to 400 entries, also from the first 8 stylesheets).
  5. Use Convert URL to turn a website address into the CDN address plus <img>, <link> and <script> snippets.

Each file is fetched once on the first request (up to 200 MB, 60 seconds, up to 3 redirects) and then delivered from the delivery folder.
To pick up changed files from the origin, click Clear delivery files.

Set up an own domain for a project

  1. Open the project settings, expand Advanced and enter the host under Own domain, e.g. cdn.example.com. Each host can belong to one zone only.
  2. Create the DNS records (A, and AAAA if available) of this host pointing to your server.
  3. Create a web server entry for the host that forwards requests to the CDN delivery of the installation, and a TLS certificate for it. Both are not created automatically.

The files are then reachable as https://cdn.example.com/<folder>/<file> –
without the zone name in the path.

Clear delivery files

The Button Clear delivery files in the zone starts a background job that removes all prepared files of the zone.
Nothing in the project storage is touched;
the next request builds each file again.
Unticking Zone on switches the zone and the CDN delivery of the project off: its addresses then answer with 404.

Backups

The delivery folder only contains files that can be rebuilt;
it does not need a backup.
What matters is the source: for project zones the objects in CDPStorage, for origin zones the origin website.
Project data can be copied with any tool that speaks the S3 API generically –
set the endpoint https://<STORAGE_HOST>, path-style addressing, Signature V4, any region string such as eu-fra, and a key with read permission for the project.
Such tools are not part of CDPShare and are not tested by us.
On the server, the installation's backup command saves the database and the configuration including the master key.

Protection and security

  • CDN addresses are public. Keep private files in projects whose CDN delivery is switched off (project settings → CDN delivery), and share them with password-protected share links instead.
  • Upload keys: give access keys only the permissions they need (read, write, delete), restrict them to a project or prefix, set an expiry date and an IP allow list.
  • Administrators sign in with a one-time code (TOTP); only they can change zones.
  • Safe delivery: SVG files are stripped of scripts, event handlers, embedded foreign objects and external references and delivered with Content-Security-Policy: sandbox; script-src 'none'; HTML from project zones is sent as a download.
  • Storage side: the sources are encrypted at rest with the server's master key, replicated to several nodes (default 2 copies), and deleted files stay in the trash for 30 days – their plain CDN addresses and image sizes are removed immediately. Versioned addresses that were already built stay in the delivery folder until you click Clear delivery files.
  • Rate limit: requests that make the server build a file are limited to 30 per second per IP address (burst 60).