Menu

Expiring Signed URLs: Why Some Download Links Die After Minutes
πŸ“°

Expiring Signed URLs: Why Some Download Links Die After Minutes

DEV Community: phpΒ·Mobeen AhmedΒ·9 days ago
#GxKt5Myd
#devto#dev#signed#download#file
Reading 0:00
15s threshold

If you have ever pasted a video link into a downloader, got a perfectly good download link, and then come back ten minutes later to find it dead, you have met an expiring signed URL. It is not a bug. It is the CDN doing exactly what it was told to do, and once I understood how it works, it changed how I built my downloader.

What a signed URL actually is

A signed URL is a normal file URL with a few extra query parameters bolted on: an expiry timestamp, and a signature computed from the path, the expiry, and a secret key only the CDN knows. When a request arrives, the CDN checks the signature, then checks the clock. If the timestamp has passed, it returns a 403, even though the file is still sitting there. You cannot just edit the expiry to a later date either β€” the signature would stop matching, and the request would be rejected anyway.

The idea is simple. A video platform does not want its files to be hotlinked forever.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.