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
Landing page turnkey
Selling landing page turnkey: offer, structure, design, development, SEO foundation and ad launch. From 10,000 UAH.
from 10,000 UAH
Corporate website
Corporate website turnkey: company presentation, service catalog, CRM, admin panel, SEO structure. From 18,000 UAH.
from 18,000 UAH
Online store
Online store turnkey: product catalog, cart, online payment, CRM and warehouse integrations, SEO structure. From 25,000 UAH.
from 25,000 UAH
Need this for your project?
Development turnkey: analysis → implementation → launch → support. Tell us about your task — we will reply with an estimate.
Relevant articles
Robust Support Chat Architecture: Presence Leases, Reconnects, and Message Guarantees
Learn how to architect resilient B2B support and dispatch chats with server-managed presence, monotonic event streams, and reliable reconnect logic.
Building Resilient Cashless and RFID Systems for High-Capacity Venues
Discover how to design edge-first architectures for high-throughput cashless payments and RFID credentials that remain functional even when connectivity fails.
Securing AI Agents in Enterprise Systems: Moving Beyond God-Mode Accounts
How to safeguard internal systems when deploying autonomous AI agents? Learn about delegated credentials, boundary gateways, and tamper-evident audit logs.
AI Agent Security: Why Approving Verbs Instead of Objects Puts Business at Risk
Learn why traditional human-in-the-loop workflows in AI agents fail to prevent parameter tampering and how to architect secure validation layers.
Web3 Data Architecture: How to Accurately Track Token Supply and Liquidity
Why standard database queries to blockchain indexers produce misleading metrics and how to engineer dependable pipelines for on-chain data.
Document Retention and Deletion in Cloud Storage: An Architectural Blueprint
Learn how to build a reliable document retention engine, enforce strict multi-tenant isolation, and separate business deletion promises from cloud object storage.