Gzip on firebase hosting on/off ?!
Good afternoon, I'm facing a strange problem.
I’m making a personal website, and I’m using firebase tools and also deploying this site on the firebase hosting. For that I have 3 projects
"projects": {
"default": "kate-photo-site",
"staging": "katia-898f2",
"production": "kates-eye"
}
One day after deploying a new version , I noticed that the page opens much more longer than usual. Website based on Nuxt framework and using Webpack, so after every build process I see the size of any of generated files, and it remains the same (it's about 407kb for vendor.app.js for ex.). However, earlier the browser received a compressed file, which had a size of 114 kb, and now uncompressed, whose weight is 400+ kb.
And at the same time, when I publish the same code on another project, everything is fine!
I started looking into the browser console, and found the difference. The code is really not compressed, and is given by a server called "Google Frontend" whereas in another project, the files are given by the nginx servers and the files are compressed! _Console - Network - vendors.app.js - Headers: for : https://kates-eye.firebaseapp.com/
- content-encoding: gzip
- content-length: 116842
- server: nginx
and
for : https://kate-photo-site.firebaseapp.com/
- content-length: 456081
- server: Google Frontend
For example the resource size for vendors.app.js is the same = 445kb!
I don’t have any explanation why it happens, maybe you could find something for me? Thanks!
Update: Today project https://kates-eye.firebaseapp.com/ is OK, files are gzipped. But the third project : https://kate-photo-site.firebaseapp.com/ is always without compression. I don’t care if this happens sometimes, but there is no guarantee that such a condition will not remain on the prod project .. Does anyone have any ideas?
Update 2: https://kates-eye.firebaseapp.com/ and https://kates-eye.com it's the same project, but while accessing through kates-eye.com, compression is disabled, but through kates-eye.firebaseapp.com/, it is turned on! what's happening ?
We are in the process of rolling out some new infrastructure, and this might be a bug. The rollout is applied randomly to a subset of hostnames on Firebase Hosting, so that likely explains the discrepancy. We will investigate the underlying issue.
On Sun, Aug 18, 2019, 10:52 AM olegpopovskiy [email protected] wrote:
Update 2: https://kates-eye.firebaseapp.com/ and https://kates-eye.com it's the same project, but while accessing through kates-eye.com http://kates-eye.com, compression is disabled, but through kates-eye.firebaseapp.com/ http://kates-eye.firebaseapp.com/, it is turned on! what's happening ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/1604?email_source=notifications&email_token=AAAAH7RNHEXGQ5MKJNPGGDLQFGD7NA5CNFSM4IMPU6AKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RE24Y#issuecomment-522341747, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAH7X3SGGYY5HT45RSKFDQFGD7NANCNFSM4IMPU6AA .
We're experiencing this issue also.
This should be fixed now. But please let us know if you're still running into it (and ideally the URL that it is happening on).
This issue is still occurring for me, it was resolved for about 3 days and now it seems like it came back.
Screenshot is also attached

I am running into this issue now . Even though , I am never explicitly setting content encoding to GZIP, few response headers have the content-encoding flag set.
For ex :
For the same endpoint : https://project-name.cloudfunctions.net/app/api/v1/discover
different query parameters respond with different headers.
Case 1 : with query-parameter : US

The response does not have content-encoding = GZIP
Case 2 : with query-parameter : DE

Response has content-encoding = GZIP
The problem is , as of now client is now equipped to handle gzipped response. Is there something that I am doing wrong or something that I am missing ?
Can someone throw some light on this ?
Thank you for your response. I am still trying to figure out this issue . I am not sure if I have made any mistake on my end . I have never explicitly set "accept-encoding" header on request side and more importantly never set "content-encoding" header on the response side . *What baffles me the most is , how within the same project and same endpoints, different query parameters give different results. *
Also as per Michael Bleigh's comment https://github.com/firebase/firebase-tools/issues/1604#issuecomment-522348360 , the new infrastructure rollout is applied to a subset of hostnames and that was the root cause of the issue. In my case, its the same endpoint / same domain . Just different query parameter.
How should I be approaching this ? The end-point is being consumed by Android Client and it seems to be working fine ( in a test app written to test endpoints) . As per documentation of HttpUrlConnection https://developer.android.com/reference/java/net/HttpURLConnection.html ,
" By default, this implementation of HttpURLConnection requests that servers use gzip compression and it automatically decompresses the data for callers of URLConnection.getInputStream() https://developer.android.com/reference/java/net/URLConnection.html#getInputStream(). The Content-Encoding and Content-Length response headers are cleared in this case."
While this does say that gzip response will automatically be handled by HttpUrlConnection , I am still not convinced that i can push things into production as I dont know why the response gets gzipped in the first place and there are still too many unknowns !
Thanks in advance for the guidance !
On Tue, Nov 5, 2019 at 8:23 PM pjbrown11 [email protected] wrote:
Not sure the protocol on commenting on closed tickets, but since @Memeriaj https://github.com/Memeriaj asked to let him know if this cropped up again, that is what I'm doing.
Here are another few example URLs where no compression is happening.
The first is https://thegoat.tech/
I don't explicitly set any config for compression (I guess I assumed that was the default and I only recently just checked on it, finding out it isn't currently gzipping anything). I tried to add the "accept-encoding" request header to the firebase.json config file, but that didn't do anything after deploying.
Some files (my html document) appear to pass the request header of "accept-encoding: gzip, deflate, br", but the response headers do not contain "content-encoding".
For my JS, there isn't anything within the request headers to indicate compression.
Other sites I have that also contain no compression on any files:
https://quickfantasystats.com/ https://bigcreekbarkery.com/
I'm using [email protected] for the first two URLs and @7.0.0 on the last.
Please let me know if there is any other info I can provide to help assist this issue.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/1604?email_source=notifications&email_token=AB4XDAHBAJAQRZK7SZC2RWLQSGCFBA5CNFSM4IMPU6AKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDC6Q2Q#issuecomment-549841002, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4XDAD5VWS7AIMLBKBO6GTQSGCFBANCNFSM4IMPU6AA .