You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I create a server side rendered react app, for compression I use webpack plugin to compress js files into gzip and brotli. It compressed successfully. But, I got an issue about response header. It always return content type gzip.
If I only compress the js files into brotli, and run the project. The response header return content of application/javascript;charset=UTF-8.
My project runs locally using nodemon (No SSL), I use Latest Chrome and Latest Express static gzip.
is there any configuration that I need to use to make the header return content type of brotli?
In general this seems to be correctly configured and the response in gzip seems to be correct as well. I'm nur sure I understand the full issue. Maybe you can describe what you want to achieve, and what content-encoding you might expect.
Just to explain, why I think, your setup seems to work fine (maybe this helps):
Your Browser is asking for content with gzip or deflate encoding ("Accept-Encoding"-Header)
You set up your server to prefer brotli over gzipover other compressions (orderPreference). This will overwrite the browsers preferences and serve what is supported by the browser, but prefered by the server
So when your browser asks for gzip or deflate, expressStaticGzip will try to serve brotli (as it's highes in your orderPreference), but won't find it supported by the browsers accept-encoding header. Therefore it will serve gzip, as it's next in your orderPreference.
Hello,
I create a server side rendered react app, for compression I use webpack plugin to compress js files into gzip and brotli. It compressed successfully. But, I got an issue about response header. It always return content type gzip.
If I only compress the js files into brotli, and run the project. The response header return content of application/javascript;charset=UTF-8.
My project runs locally using nodemon (No SSL), I use Latest Chrome and Latest Express static gzip.
is there any configuration that I need to use to make the header return content type of brotli?
This is my code screenshot and the response header:
https://res.cloudinary.com/spacesam/image/upload/v1564329266/code-gzip.png
https://res.cloudinary.com/spacesam/image/upload/v1564329215/gzip.jpg
The text was updated successfully, but these errors were encountered: