toDreepUrl() turns the URLs you use today into Dreep URLs. The file’s path and any
transform options stay the same.
Signature
It swaps
from for to, and turns /cdn-cgi/image/ into /_img/. Cloudflare reserves
/cdn-cgi/ on every domain it serves, so Dreep reads the same options under /_img/.
A URL that doesn’t match from comes back unchanged, so you can run it over
everything you store.
Presets in the path
If your own image worker puts a size in the path, like/i/lightbox/<file>, mark that
position in from with :preset:
to is your Images URL from Settings > Storage. If you’ve
pointed your own domain at Dreep,
use that instead, such as https://images.example.com.
- A preset listed in
presetsgets those settings. - Any other preset becomes
?p=<name>, so create a Dreep preset with the same name. If there’s no such preset, Dreep answers400. - A URL with no file after the preset, like
/i/lightbox, comes back unchanged.
Keeping your own domain
If you point your own domain at Dreep, pass it as bothfrom and to. Only /cdn-cgi/image/ changes:
Updating stored URLs
Run it once over the URLs in your database:Resizing the new URLs
Passtransform to add options while converting:
url() like any other Dreep URL: