Gzip Compression for Lucee-Generated Files (Lucee vs. Apache)

Hi Folks,

I have the following in .htaccess:

########################### Compression########################################

compress text files

AddOutputFilterByType DEFLATE application/ecmascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
#==============================================================================#

I noticed that this worked as expected for static files, but for Lucee
files, it didn’t. I then enabled gzip compression within the Lucee admin
(which did result in gzipped responses), but noticed that some of our
peripheral services (i.e., site health monitor and F5) didn’t work well
with gzipped health check pages. Therefore, I want to be more selective as
to what’s gzipped (or rather, just decare what I *don’t *want gzipped).

While Googling this morning, I saw allusions to configuring web servers to
compress proxied content (e.g., Lucee and Tomcat). If that’s possible, how
do you configure that in Apache?

In case it matters, here are the proxy settings from the virtual host:

############################# mod_proxy ####################################

<Proxy *>
Allow from 127.0.0.1

FR timeout (90s) + Potential FR Queue (60s) + Buffer (5s) = 155

ProxyTimeout 155
ProxyPreserveHost On
ProxyPassMatch ^/(.+.cf[cm])(/.)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+.cfchart)(/.
)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassReverse / http://127.0.0.1:8888/

#==========================================================================#

Thanks,
Jamie

Hi Jamie,

I wonder if this is an ‘order of execution’ problem? Technically, your generic output filters should also process proxied content, but maybe the order in which the statements are executed is causing the proxied content to get missed.

If you added the output filters inside the statement, does your content get compressed properly?

Did some digging, and this guy is using a similar config and compression appears to work for him when he puts his output filter param inside the proxy statement:

Maybe this structure will work for you too?–
Kind regards,
Jordan Michaels
Vivio Technologies

----- Original Message -----
From: “Jamie Jackson” <@Jamie_Jackson>
To: “Lucee” lucee@googlegroups.com
Sent: Monday, January 4, 2016 8:22:33 AM
Subject: [Lucee] gzip Compression for Lucee-Generated Files (Lucee vs. Apache)

Hi Folks,

I have the following in .htaccess:

########################### Compression
########################################

compress text files

AddOutputFilterByType DEFLATE application/ecmascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
#==============================================================================#

I noticed that this worked as expected for static files, but for Lucee
files, it didn’t. I then enabled gzip compression within the Lucee admin
(which did result in gzipped responses), but noticed that some of our
peripheral services (i.e., site health monitor and F5) didn’t work well
with gzipped health check pages. Therefore, I want to be more selective as
to what’s gzipped (or rather, just decare what I *don’t *want gzipped).

While Googling this morning, I saw allusions to configuring web servers to
compress proxied content (e.g., Lucee and Tomcat). If that’s possible, how
do you configure that in Apache?

In case it matters, here are the proxy settings from the virtual host:

############################# mod_proxy ####################################

<Proxy *>
Allow from 127.0.0.1

FR timeout (90s) + Potential FR Queue (60s) + Buffer (5s) = 155

ProxyTimeout 155
ProxyPreserveHost On
ProxyPassMatch ^/(.+.cf[cm])(/.)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+.cfchart)(/.
)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassReverse / http://127.0.0.1:8888/

#==========================================================================#

Thanks,
Jamie


Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b846328e-13c2-4114-a75a-206bf2e64811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.