Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compress with gzip on firebase

I'm trying to compress my .css and .js on my firebase hosted web to increase loading speeds, however I've been unable to use the firebase.json config file to correctly setup a gzip compression for my assets.

The curl -v command shows that no compression is performed when serving the files from the server. Also checked in the network section of Firefox Developer edition.

The furthest I've been able to go has been a load error on my browser because of my .json configuration.

"source": "**/*.@(jpg|jpeg|gif|png)",
"headers": [
  {
    "key": "Cache-Control",
    "value": "max-age=7200"
  },
  {
    "key": "Content-Encoding",
    "value": "gzip"
  }
]

This has been my try on the firebase settings resulting in the browser not loading any of the css nor the js.

Any thoughs?

Thanks!

like image 913
olmedocr Avatar asked Aug 31 '25 22:08

olmedocr


1 Answers

Firebase Hosting has a size threshold for compressing files.

All the files that were uncompressed were small (<1K), so they didn't meet that threshold.

like image 138
Frank van Puffelen Avatar answered Sep 03 '25 12:09

Frank van Puffelen