TL;DR: Routing heavy file uploads through your app server spikes RAM and prevents horizontal scaling. StakCMS bypasses the server entirely, using Pre-Signed URLs to let clients upload straight to Google Cloud Storage.
The Infrastructure Anti-Pattern
If your CMS allows marketing teams to upload 500MB uncompressed videos, routing that upload through your core application server is an infrastructure anti-pattern.
It eats up PHP workers, spikes container memory, and permanently limits horizontal scaling. If you are running on Google Cloud Run or AWS Fargate, local disk space is ephemeral anyway. If the container restarts while buffering the file, the file vanishes.
Direct to Cloud Architecture
In StakCMS, we completely bypass the application server for large media files using Google Cloud Storage (GCS) Pre-Signed URLs.
Here is how the MediaUploadController handles it:
// MediaUploadController.php
public function generateUploadUrl(Request $request)
{
// 1. Generate a time-limited V4 Signed POST Policy for GCS
$uploadData = $this->uploadService->generateSignedUploadUrl(
$validated['filename'],
$validated['contentType'],
$folde
);
// 2. Hand it directly to the browser
return $this->respondSuccess([
'is_direct_upload' => true, 'upload_data' => $uploadData
]);
}
The browser uploads the heavy binary blob directly to Google's CDN edge nodes. Only after GCS confirms the upload does the client ping our /media/finalize endpoint with the metadata



