Back to writes

Serving Course Assets Safely with Cloudflare R2 Signed URLs

1 min readcloudflare, storage, backend

How to keep PDFs and study assets private in object storage while streaming them quickly to enrolled students.

Public bucket URLs are convenient until paid course materials start circulating outside your platform. Short-lived signed URLs let your application authorize the request without proxying megabytes through your API server.

Keep buckets private by default

Verify enrollment in your backend, then mint a 60-second presigned GET URL directly against R2.

Thanks for reading.

Md Afzal Mir

Home
action
Work
action
Writes
action
About
action
Uses
action
Bookshelf
action
CAART
Multi-tenant WhatsApp-first SaaS catalog and storefront engine enabling local businesses to launch online stores and convert orders directly.
project
AI Smart Class
Multi-role EdTech LMS with RBAC, adaptive video streaming via Bunny.net, Excalidraw whiteboard, and automated MCQ assessments.
project
Alumni Portal
Community directory and event registration platform automating attendee onboarding and instant ID card generation.
project
Wallet X
Digital wallet fintech demo with Zod schema validation, real-time balance updates, and automated receipt generation.
project
Designing Multi-Role RBAC in Next.js and Postgres
Practical patterns for separating tenant membership, role permissions, and route guards when building B2B SaaS dashboards.
write
Serving Course Assets Safely with Cloudflare R2 Signed URLs
How to keep PDFs and study assets private in object storage while streaming them quickly to enrolled students.
write
Arrow keys to navigate⌘K