Short answer: Sign URLs when the server must prove that a caller may access an asset or request a restricted transformation. Keep the signing key on trusted infrastructure, cover every policy-relevant field, use bounded expiry where appropriate, and separate access proof from cache identity.
Public marketing images usually do not need per-request signatures. Private customer documents, embargoed media, paid content, and expensive transformation capabilities often do. The important question is what the signature authorizes.
Delivery authorization or transformation authorization?
Delivery authorization answers whether a requester may receive an asset. A token may include asset identity, expiry, and perhaps a user or policy scope. The server validates it before returning bytes.
Transformation authorization answers whether a requested derivative is allowed. A public source might permit a few safe presets but require a signature for arbitrary overlays, very large output, or remote fetches. This protects compute and prevents unauthorized manipulation.
The two concerns can share a signature scheme but should remain explicit. A URL that proves access to one original should not automatically authorize every possible transformation of it.
Cloudinary documents signed delivery and transformations in its authentication signatures guide. Cloudflare documents signed URLs for Images in its private images guide. The algorithms and token fields differ, so follow the provider’s canonical implementation.
What must the signature cover?
Cover the asset identifier and version, normalized transformation or preset, expiry, and any policy scope that the verifier enforces. If width or crop can be changed without invalidating the signature, the token does not control those operations.
Canonicalize before signing. Parameter order, encoding, default omission, and numeric formatting must be deterministic on both sides. Use one typed URL builder rather than reimplementing signature strings in multiple clients.
Do not invent a cryptographic format when the provider supplies one. Use maintained libraries where available, compare signatures in constant time on systems you operate, and rotate keys through a documented process.
Where should signing happen?
Only on a trusted server, edge worker with protected secret storage, or another controlled backend. Never ship the signing secret in browser JavaScript, a mobile application, a public repository, or page markup.
The browser can request a short-lived URL from your application after authentication. The application checks business authorization and returns the minimum capability required. For pages rendered on the server, it can generate signed URLs during rendering.
Avoid exposing administrative API credentials when only a delivery signature is needed. Use the narrowest credential and isolate image signing from unrelated account operations.
How long should a signed URL live?
Choose expiry from the sensitivity of the content, expected viewing session, CDN caching model, and failure tolerance. A very short expiry can break slow clients, saved pages, retries, and caches. A very long expiry behaves more like a revocable secret link.
Expiry limits future use but does not retract bytes already downloaded. For highly sensitive images, combine short-lived authorization with application controls, logging, and a realistic understanding that the client can copy visible content.
Clock skew should be considered. Log the verifier’s rejection reason internally without revealing signing details to callers. Provide enough margin for normal request delay.
How do signatures interact with caching?
If each signed URL contains a unique token and the CDN includes it in the cache key, identical bytes can fragment across many entries. Some systems validate the token and then cache by stable content identity. Others require deliberate cache-key configuration.
Never ignore a security parameter at the cache without ensuring authorization still runs on every protected request. A cached private response must not become publicly retrievable merely because the token was removed from identity.
The cache key design guide explains content identity versus access proof. Test the actual sequence with valid, invalid, expired, and missing tokens, including a warm cache.
What should you monitor?
Track signature validation failures by reason, requested asset or policy class, credential ID, and rate. Avoid logging full tokens. Alert on unusual failure bursts, high-cardinality transformations, repeated requests near expiry, and use of a retired key.
Keep an audit trail for signing operations involving sensitive assets. Record which trusted service issued the capability and the policy applied. Do not record more personal data than necessary.
Pair signing with the private image delivery patterns appropriate to your threat model. A signature is one control within an access architecture, not a declaration that the entire path is private.
Use signed URLs when they express a specific, enforceable capability. Scope them narrowly, generate them only in trusted code, test cache behavior, and make failure visible to operators.








