Back to blog

SaaS Object Storage Architecture: Handling Expired Signed URLs Correctly

Learn why storing signed URLs in your database breaks SaaS applications and how to design a resilient, secure media delivery pipeline using private buckets.

Nov 12, 2026
7
directions
notes from delivery practice
3
levels
strategy · process · tools
1
library
guides · checklists · cases
See cases

Why Expired Download Links Break SaaS Applications

In many SaaS products, users occasionally encounter broken media assets: generated PDF reports, AI-rendered graphics, or uploaded attachments suddenly fail to load in the web dashboard. Instead of the expected preview, the browser renders a broken image placeholder or throws an HTTP 403 Forbidden error. In most cases, the culprit is an architectural flaw: the engineering team stored a pre-signed download URL directly in the database as if it were a permanent identifier.

Pre-signed URLs are designed to expire. When they do, the user experience degrades instantly. To patch this, some teams make the entire object storage bucket publicly accessible. This introduces a major security hazard: confidential customer files become unprotected, while the core issue of backend authorization remains unaddressed.

Core Principle: The URL Is Delivery State, Not the Asset

A reliable architecture requires separating three states that browsers often conflate: the database record, the physical file in object storage (AWS S3, Cloudflare R2, etc.), and the temporary authorization token embedded in the URL. Only the signed link is disposable.

Your application database should strictly store durable metadata: the bucket identifier and the object key. The pre-signed URL itself should be generated dynamically and treated as transient delivery state.

A Resilient On-Demand Refresh Pattern

  • Persist immutable references: When a file is created or uploaded, store its object key, bucket, and tenant ownership in your database.
  • Route preview requests via API: When the client needs to display or download an asset, it requests a fresh URL from an authenticated backend endpoint rather than accessing storage directly.
  • Verify object state (HEAD request): The application server verifies permissions and confirms the object exists using a lightweight HEAD call before requesting a signature.
  • Issue short-lived signed links: The server signs a URL with an explicit expiration window (such as 15 to 30 minutes) and returns it to the client.
  • Frontend error handling: The browser caches this URL within its validity period. If an expired error occurs during an active session, the frontend automatically requests a new link from the API without page reloads or user disruption.

Storage Cost Optimization: Retention vs. Link Lifespan

Cloud storage invoices are driven by stored byte-days, request counts, and data transfer. Shortening a URL's expiration window does not reduce your storage bill if unneeded assets sit in your bucket indefinitely.

To keep infrastructure expenses predictable, establish strict storage lifecycle policies. Separate canonical assets from derivative previews. For example, retain the master artifact for the contractually agreed period (e.g., 30 days) while configuring disposable thumbnails and previews to expire automatically after 24 hours.

ViAcore Implementation Checklist

When developing media handling modules for B2B SaaS platforms, our team follows these core standards:

  • Keep buckets private: Never enable public-read ACLs on tenant-scoped data storage.
  • Isolate credentials: Your platform API tokens and cloud credentials must never leak to the client; the signature inside the presigned URL is the only secret the browser needs.
  • Implement smart caching: Use a fast application-level cache to avoid re-signing dozens of identical object links when users refresh galleries or dashboards.

By decoupling the physical asset from its temporary access token, you eliminate broken links, protect customer privacy, and ensure your SaaS platform scales seamlessly.

Services on this topic

Need this for your project?

Development turnkey: analysis → implementation → launch → support. Tell us about your task — we will reply with an estimate.

About the direction

Relevant articles