Home › Docs › CDPCDN – Getting started

Docs

CDPCDN – Getting started

This page takes you from a fresh installation to the first image delivered through CDPCDN –
including the responsive image sizes and a ready srcset block.
Allow about ten minutes.

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

Before you start

  • CDPDrive is installed with three host names, and the CDN host has a DNS record and a TLS certificate (see Offering).
  • You can sign in to the web interface on https://<DRIVE_HOST> as an administrator (administrators confirm their sign-in with a one-time code app).
  • Under Settings → Modules the switch "CDN module (delivery, image sizes)" is on and the licence contains the CDN product. Open https://<CDN_HOST>/: a short status page with HTTP 200 means the module is active; HTTP 503 means it is switched off or not licensed.

Step 1: Create a project

  1. Open Projects → New project.
  2. Enter a project name, e.g. Shop images. The bucket name is filled in automatically (lower case, 3–63 characters) and can be edited, e.g. shop-images.
  3. Optionally leave "C-Muster folders" on to create the folder structure core/assets/css, js, gfx/ico, png, svg, webp/logos.
  4. Click Create.

Every new project is delivered three ways from the start: share links (CDPDrive), S3 (CDPStorage) and CDN.
The CDN zone is created automatically;
its name is the bucket name.
You can check it on the page Delivery.

Step 2: Upload an image

Open the project in the file browser and drag an image (JPG, PNG, WebP, GIF, AVIF or BMP) into a folder, e.g. products/.
Images can also be uploaded through the S3 API of CDPStorage.
After every image upload into a project with CDN delivery a background job prepares the original and all configured sizes, so the first visitor already gets ready files.

Step 3: Copy the addresses

Click the Button Use next to the file.
The dialog "Use this file" shows, each with a copy function:

  • the CDN address: https://<CDN_HOST>/<ZONE>/products/chair.jpg
  • the image sizes: …/products/chair-480.webp, …-960.webp, …-1440.webp
  • the optional address with version code for cache-busting: …/products/<version>/chair.jpg
  • a ready srcset block, the S3 address and a share link.

Step 4: Embed the image in a website

<img src="https://<CDN_HOST>/<ZONE>/products/chair-960.webp"
     srcset="https://<CDN_HOST>/<ZONE>/products/chair-480.webp 480w,
             https://<CDN_HOST>/<ZONE>/products/chair-960.webp 960w,
             https://<CDN_HOST>/<ZONE>/products/chair-1440.webp 1440w"
     sizes="(max-width: 960px) 100vw, 960px" alt="Chair">

The browser picks the matching width.
A size is never enlarged: if the original is narrower than the requested width, it is delivered at its original width in the zone format.

Step 5: Check the result

  • Open the CDN address in the browser. The response carries Cache-Control: public, max-age=86400 for the plain address and max-age=31536000, immutable for the versioned address (with the default cache time).
  • On Delivery → zone → Addresses & embedding you see the address scheme, the list of files with CDN addresses and the last delivered files.
  • When you upload a new version under the same name, the plain address delivers the new content (browsers may keep the old one for up to one day).

Alternative: deliver files of an existing website

If your files are on an existing website, open Delivery → New zone → Advanced: pull files from an external website (origin pull), enter a zone name and the origin website (e.g. https://www.example.com) and click Create origin zone.
A file https://www.example.com/img/logo.png is then reachable as https://<CDN_HOST>/<ZONE>/img/logo.png.
Details are in the Guides.