Does Lucee automatically perform gzip compression ...
# lucee
o
Does Lucee automatically perform gzip compression if the user's browser supports it or do I have to enable it somehow?
g
Lucee admin says "Enable compression (GZip) for the Lucee Response stream for text-based responses when supported by the client (Web Browser)"
I think most browsers will send gzip in the Accept-Encoding headers
and if you're doing lots with JSON / ajax / fetch check your request headers using something like chrome - console - network
o
Lucee admin says "Enable compression (GZip) for the Lucee Response stream for text-based responses when supported by the client (Web Browser)" What Lucee Admin?
a
This seems odd to me. How is it Lucee's job to do this, and not the web server's? Doesn't Lucee only talks to the web server, not the client browser..?
👍🏻 1
a
I'd assume that in almost every situation you'd have lucee behind a web server @zackster might know why you'd select this but I'd personally want lucee request to be as fast or lean as possible and have nginx or apache handling this
a
Even if one is just using Tomcat's web server... it's still Tomcat's webserver (Coyote?), not Lucee's. Right? Right? Very intrigued now.
a
Well that's prob the only instance that maybe it does make sense to have that option but don't know enough about how one is expected to work with Coyote soShri
g
Haven't CF -> web server implementations always just been proxies anyway?
a
Tomcat's web server is considered production-ready these days. The one CF used to use (still uses?) for its "internal dev web server" isn't. Well: wasn't. Still: you don't really want yer application server and web server in the same zones anyway. No need for an app server to be outside the DMZ, and it's a potential pen vector if it is.
g
I was of the impression that CF and Lucee IIS and apache connectors both just proxy to the relevant container webserver ( in this case tomcat )
1
b
I recall when this was added back in the Railo days and I think was more one of those, "Hey cool, what if we did GZip compression at the Java layer so it can be enabled when hitting the servlet container directly". I presume it's unnecessary in nearly all cases these days. Even CommandBox/Undertow has GZip compression built in.
f
yeah - best to let the web server do this, I’ve seen issues due to enabling it in Lucee (or maybe it was in Railo… it was a few years ago, but was messy enough to make me not want to enable it again)
☝️ 1
Additionally, it’s not always just a proxy to the container… ACF connector uses the AJP protocol (with a bit of their own proprietary stuff), it’s not a http proxy. Many lucee servers would however just be a http proxy to tomcat or undertow/commandbox, etc, but Lucee with IIS would probably be using BonCode AJP connector.
z
Sure, it's an opt in feature isn't it?
💯 2
o
Some languages allow you to opt in via built in functions
Copy code
<?php ob_start("ob_gzhandler"); ?>
while others simply require you use a module: https://www.npmjs.com/package/compression I didn't know if I had to do anything special