Skip to content

Implement Cloudflare CDN Proxy for Blob Storage Egress #80

@AB-Law

Description

@AB-Law

Problem
Even with stable SAS URLs, all image traffic currently flows directly from Azure Blob Storage to the user's browser. Azure Storage charges for data egress, and latency is dependent on the user's distance from the Azure region. Without a CDN, every single "Wardrobe" view results in a direct hit to the origin storage, even if the image hasn't changed in months.

Impact

Factor Impact
Cost 100% of image bandwidth is billed as Azure Egress (after the 100GB free tier).
Latency Users far from the data center experience slower image load times.
Origin Load High volume of unnecessary GET requests to the Azure Storage account.

Proposed Fix
Route all blob traffic through a Cloudflare CDN layer using a custom domain (e.g., cdn.pluckit.com).
Set up Cloudflare DNS with a CNAME pointing to the Azure Storage endpoint.
Update BlobSasService.cs to swap the host portion of the generated URL from *.blob.core.windows.net to the custom CDN domain.
Configure Cloudflare "Cache Everything" rules to respect the SAS token duration.

Functionality Impact
Users will see images served from cdn.pluckit.com instead of the Azure URL. Load times will improve significantly on repeat visits, and Azure egress traffic will drop toward zero for cached assets.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions