Closed cythilya closed 6 years ago
Can you provide a specific example URL to call so I can test the same one (since there are lots of URLs in that app)?
Yea, I'm also not seeing it as compressed. Is there a way to attach a debugger into the running code on Heroku to see what is happening?
Same here, my assets are not being compressed and they are reported by google page speed as not compressed :)
CSS and JS files are being compress, everything else, is not. Weird.
Using:
"compression": "^1.7.3",
"express": "^4.16.3",
"node": "8.10.0"
Here is my site.
If you check the network panel, you'll see how the only assets being compressed are CSS & JS file. Fonts, svgs, etc are not.
This is how I use the module:
Thanks
Actually, this problem is not related to Heroku, as in local the same results are outputted on the network tab.
So, its reproducible also in local environments.
Hi @Avcajaraville sorry to hear you're having the same issue. I would live to debug through the issue to get to a resolution. Can you provide code and steps to reproduce so I can examine?
@dougwilson I just set a minimum gist that reproduces the issue here
As you can see, the css file is being gzip, while the svg is not:
Ah, thanks @Avcajaraville ! This is because the SVG file in your example does not exceed the default value for the threshold
option (https://github.com/expressjs/compression#threshold) which is 1kb. Responses below that threshold size are not compressed. You can lower the threadshold if you need it compressed 👍
Thanks a lot @dougwilson that was a super useful and quick answer :)
This is also the reason why this is not working for @cythilya.
We should read the docs more carefully :)
Really nice response time and great job with this module !!
It's no problem! Happy to help.
I have gzip when I run "yarn run dev" in local, but after I run "heroku local" or deploy my app to Heroku, gzip is gone. Below are my code snippet.
package.json
server.js
or view my repo and demo.