I have a SPA (sing page app) built with React + Firebase.
This is the flow:
firebase.json
- Rewrites everything to my cloud run
expressserver. - I have a connected custom domain on my Firebase Hosting:
www.example.com
"rewrites": [
{
"source": "**",
"run": {
"serviceId": "server",
"region": "us-central1"
}
}
],
In Firebase Hosting docs, we can see that Firebase Hosting serves content over the CDN with gzip enabled by default.
Given that fact, does it make send to turn on the compression on my express server over on Cloud Run?
Example:
const app = express(); // INITIALIZE EXPRESS APP
const publicFolder = path.resolve(__dirname,"../public");
app.use(compression());
app.use(express.static(publicFolder));
I'm guessing that it makes sense, because Firebase Hosting compresses the data from the Hosting CDN to users, and my express server will compress data from Cloud Run to Hosting CDN, is this correct?
