- Deleting an image from origin storage does not remove it from global CDN edge caches until its TTL expires.
- Traditional Cache-Control headers leave cached copies active across hundreds of edge nodes for days.
- Decoupling public slugs from storage filenames allows instantaneous edge cache purging by exact URL key.
- Mobile IP roaming during batch uploads is resolved using stateless HMAC-SHA256 session tokens.
- PoofShare pairs 15-minute background disk shredding with immediate edge cache purges for sub-second removal.
The CDN Ghost File Problem
When a user deletes an image, they expect it to vanish from the internet immediately, but standard web architectures frequently fail this expectation.
The Illusion of Origin Deletion
Most image hosts handle deletion as a simple database update: unlinking the binary blob from origin disk storage. On a local development machine, this works cleanly: the server responds to subsequent requests with HTTP 404 Not Found.
In production, web applications sit behind global Content Delivery Networks with hundreds of edge Points of Presence (PoPs). When an image is first viewed, the nearest edge node pulls the asset from origin storage and caches it locally according to response headers:
HTTP/1.1 200 OK
Content-Type: image/png
Content-Length: 1482910
Cache-Control: public, max-age=86400, s-maxage=604800, immutable
ETag: W/"16a2f-7c5cff"Edge nodes cache the image for seven days (s-maxage=604800), while client browsers store it for 24 hours (max-age=86400). When the user clicks delete five minutes later, the origin database drops the record and unlinks the disk blob.
However, edge nodes in Tokyo, London, and New York never contact origin storage while their cache timer remains active. They continue serving the cached 1.48 MB payload with HTTP 200 OK until the TTL expires. The file has become a ghost cache: deleted on disk, but live on the internet.
Concrete Privacy Failure Scenarios
Ghost caches introduce serious security hazards. Suppose an engineer captures a screen containing staging credentials, uploads it to share an interface bug, notices the leak, and deletes it within ten seconds.
If the hosting service only unlinks origin storage, anyone with the link can still view the cached copy on edge servers. Automated bots querying edge PoPs will continue downloading the live image until upstream timers expire. A file is never deleted until every edge node purges its cached buffer.
Deterministic Cache Keys and Instant Eviction
Reliable edge invalidation requires a deterministic relationship between incoming request URIs, surrogate cache tags, and underlying storage objects.
Decoupling Public Slugs From Storage Filenames
Naive hosting systems name storage files after the public slug. If /i/error-log.png maps directly to /var/data/error-log.png, deleting and re-uploading an edited file often returns stale cached versions due to cache key collisions.
At PoofShare, we decouple public URL slugs completely from physical storage identifiers. When a user uploads a screenshot, the system generates an ephemeral public slug (v8q9x7m2), while the physical storage mesh persists the asset under an immutable, content-addressed filename composed of a creation timestamp, a SHA-256 hash prefix, and a sanitized base label:
Public Route: /i/v8q9x7m2.png
Deterministic Key: https://poofshare.pages.dev/i/v8q9x7m2.png
Surrogate Cache Tag: img-v8q9x7m2
Storage Mesh Blob: 1794960000_e3b0c44298fc1c14_snap.pngThis decoupling ensures that physical writes never overwrite existing files, and edge cache keys remain strictly deterministic.
Synchronous Edge Cache Eviction
When a user triggers deletion or an upload hits its expiration window (such as 10 minutes or 24 hours), our edge gateway executes a dual-action invalidation routine:
- State Nullification: The ephemeral database record is marked expired, immediately altering route resolution logic at the edge gateway.
- Synchronous Cache Invalidation: The edge worker dispatches an atomic cache purge targeting the exact public URL key and its associated surrogate tag.
Because the edge gateway sits directly at the network perimeter, this invalidation propagates across global edge caches within sub-second timeframes. A viewer requesting /i/v8q9x7m2.png one second after deletion encounters an authoritative HTTP 404 Not Found response.
Mobile IP Roaming in Batch Sessions
Managing deletions across multi-image uploads becomes complex when users operate on mobile devices that frequently switch network environments.
The Cellular Network Handoff Problem
When an engineer uploads five error screenshots while leaving an office, their phone might start on company Wi-Fi (IP 198.51.100.42) and complete on cellular LTE (IP 203.0.113.88).
If the host ties deletion rights to the client's source IP address, the user loses control the instant their connection roams. If they need to delete the batch while commuting, the request is rejected due to IP mismatch. Requiring user accounts defeats rapid, lightweight screenshot sharing.
Stateless HMAC-SHA256 Session Tokens
To solve this problem without storing personal data, PoofShare issues a cryptographic session token during initial batch negotiation:
Payload: { "batch_id": "b_7f81a", "created_at": 1794960000, "exp": 1795046400 }
Signature: HMAC-SHA256(Payload, ClusterSecret)
Token: base64(Payload).base64(Signature)The browser stores this token in ephemeral session memory. When the user removes an image from their staged batch, the client sends the signed token in an X-Upload-Session header.
The edge gateway verifies the HMAC signature using its internal secret. Because authorization is anchored cryptographically in the token payload rather than client IP, users retain deletion rights across cellular hops, VPNs, and Wi-Fi transitions.
Background Disk Shredding vs. Immediate Edge Purging
A complete zero-trace architecture requires coordinating edge-level routing with physical storage cleanup.
The Two-Tier Eviction Model
Immediate edge invalidation ensures that the public cannot access an expired file, but binary data still resides on physical disks until cleaned up. Synchronous disk-wipe operations inside user-facing HTTP handlers degrade API responsiveness.
PoofShare decouples this responsibility across two distinct architectural layers:
- Tier 1 (Perimeter Defense): Handled directly by edge functions. When an asset reaches its expiration timestamp or receives a deletion command, edge routing immediately returns HTTP 404 and flushes CDN edge memory.
- Tier 2 (Physical Storage Mesh): A scheduled companion maintenance worker runs every 15 minutes (
<em>/15 </em> <em> </em> *), scanning database state for expired records, issuing deletion commands to storage nodes, and unlinking disk blobs.
Decoupling the edge boundary from disk reclamation delivers instantaneous user deletion while keeping origin storage clusters clean.
Review our technical architecture across our client-side upload pipeline, explore our zero-knowledge PIN gates, and inspect our data retention standards in our Privacy Policy.
Related Engineering Guides
- Pipelined Concurrency Pools in JavaScript: Overlapping in-browser CPU encoding with active network streaming.
- Browser Clipboard Paste Under the Hood: Handling multimodal OS clipboard buffers and safe object URL staging.
- Protecting Links With Client-Side SHA-256 PINs: Zero-knowledge passcode gates computed directly in browser memory.
- Stopping Image Hotlink Bandwidth Theft: Distinguishing leeching forum embeds from legitimate social chat previews.
- About PoofShare: Platform mission, zero-tracking architecture, and engineering principles.
Why does an image load after deletion?
Browsers cache files locally via Cache-Control max-age headers. Even after edge caches purge the file, previously viewed copies may load from browser disk until hard refreshed (Ctrl+F5).
How fast does an edge cache purge propagate?
Edge platforms propagate URL and surrogate-key invalidations across global PoPs in 150 to 500 milliseconds, guaranteeing immediate worldwide HTTP 404 responses.
What is the difference between max-age and s-maxage?
The max-age directive controls caching in client browsers, whereas s-maxage governs intermediate shared caches like CDN edge nodes.
How do mobile devices delete uploads across networks?
PoofShare issues an HMAC-SHA256 session token during upload. This cryptographic token authenticates deletion requests across Wi-Fi and cellular switches without storing accounts.