Trying to enable gzip in Jetty for js/css files

I’ve been trying to add gzip compression for javascript and css files on my
local machine which is using Jetty with no success. I read
this http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
but I cannot find a web.xml file, although there is a webdefault.xml which
looks promising. When I add that filter block into the file nothing works.
It crashes with a 503 Service Unavailable. The lucee console shows no
error messages, and I cannot find any jetty logs. Anyone have any ideas on
my debugging of the Jetty issue, or has this already setup? Thanks!

In \were-ever-you-extracted-lucee-express-installer\conf\ is where you will
find web.xml

I would make a backup copy of that file before you attempt to do anything
else.On Friday, March 20, 2015 at 12:37:17 PM UTC-4, Jonathan Brookins wrote:

I’ve been trying to add gzip compression for javascript and css files on
my local machine which is using Jetty with no success. I read this
http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
but I cannot find a web.xml file, although there is a webdefault.xml which
looks promising. When I add that filter block into the file nothing works.
It crashes with a 503 Service Unavailable. The lucee console shows no
error messages, and I cannot find any jetty logs. Anyone have any ideas on
my debugging of the Jetty issue, or has this already setup? Thanks!

Sorry about that.

Only how many web servers are there?

:slight_smile:

I would run an override as described here, as it seems like the cleaner
approach.
http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/override-web-xml.htmlOn Friday, March 20, 2015 at 12:37:17 PM UTC-4, Jonathan Brookins wrote:

I’ve been trying to add gzip compression for javascript and css files on
my local machine which is using Jetty with no success. I read this
http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
but I cannot find a web.xml file, although there is a webdefault.xml which
looks promising. When I add that filter block into the file nothing works.
It crashes with a 503 Service Unavailable. The lucee console shows no
error messages, and I cannot find any jetty logs. Anyone have any ideas on
my debugging of the Jetty issue, or has this already setup? Thanks!

the /conf/web.xml is a Tomcat path, not Jetty.

in both engines (as well as any other servlet engine) you can place a
web.xml in your app’s WEB-INF folder, so it would be
/{your-web-context}/WEB-INF/web.xml – it will, of course, have to be
valid as per the Servlet specification.

otherwise, in Jetty, you can simply modify webdefault.xml, which is
equivalent to {Tomcat}/conf/web.xml

if you don’t know what you’re doing then definitely make a backup. if
you know what you’re doing then also make a backup :wink:

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/On 3/20/2015 11:31 AM, Terry Whitney wrote:

In \were-ever-you-extracted-lucee-express-installer\conf\ is where you
will find web.xml

I would make a backup copy of that file before you attempt to do
anything else.

On Friday, March 20, 2015 at 12:37:17 PM UTC-4, Jonathan Brookins wrote:

I've been trying to add gzip compression for javascript and css
files on my local machine which is using Jetty with no success.  I
read
this http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
<http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html>
but I cannot find a web.xml file, although there is a
webdefault.xml which looks promising.  When I add that filter
block into the file nothing works.  It crashes with a 503 Service
Unavailable.  The lucee console shows no error messages, and I
cannot find any jetty logs.  Anyone have any ideas on my debugging
of the Jetty issue, or has this already setup?  Thanks!


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
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/8c0ff9cf-1284-4e43-8601-92148133f9d9%40googlegroups.com
https://groups.google.com/d/msgid/lucee/8c0ff9cf-1284-4e43-8601-92148133f9d9%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

Thanks for the clarification, Igal. Adding that block seems to
prevent Jetty from working. Once removed everything is back to normal.
Does Jetty automatically log exceptions anywhere?On Friday, March 20, 2015 at 2:40:28 PM UTC-4, Igal wrote:

the /conf/web.xml is a Tomcat path, not Jetty.

in both engines (as well as any other servlet engine) you can place a
web.xml in your app’s WEB-INF folder, so it would be
/{your-web-context}/WEB-INF/web.xml – it will, of course, have to be valid
as per the Servlet specification.

otherwise, in Jetty, you can simply modify webdefault.xml, which is
equivalent to {Tomcat}/conf/web.xml

if you don’t know what you’re doing then definitely make a backup. if you
know what you’re doing then also make a backup :wink:

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/
On 3/20/2015 11:31 AM, Terry Whitney wrote:

In \were-ever-you-extracted-lucee-express-installer\conf\ is where you
will find web.xml

I would make a backup copy of that file before you attempt to do
anything else.

On Friday, March 20, 2015 at 12:37:17 PM UTC-4, Jonathan Brookins wrote:

I’ve been trying to add gzip compression for javascript and css files on
my local machine which is using Jetty with no success. I read this
http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
but I cannot find a web.xml file, although there is a webdefault.xml which
looks promising. When I add that filter block into the file nothing works.
It crashes with a 503 Service Unavailable. The lucee console shows no
error messages, and I cannot find any jetty logs. Anyone have any ideas on
my debugging of the Jetty issue, or has this already setup? Thanks!


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+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/8c0ff9cf-1284-4e43-8601-92148133f9d9%40googlegroups.com
https://groups.google.com/d/msgid/lucee/8c0ff9cf-1284-4e43-8601-92148133f9d9%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

  1. what version of Jetty are you using? log files should be in default
    folder so you should check out the Jetty docs.

  2. if you are after optimizing the performance of your servers then you
    should really front Lucee with a web server like nginx (or Apache httpd
    or MS IIS).

  3. if you placed the filter element in the right place then most likely
    the class file org.eclipse.jetty.servlets.GzipFilter is not in the
    classpath, you should download the jar from the Maven repository. I
    still recommend item (2) above though.

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/On 3/20/2015 12:10 PM, Jonathan Brookins wrote:

Thanks for the clarification, Igal. Adding that block seems
to prevent Jetty from working. Once removed everything is back to
normal. Does Jetty automatically log exceptions anywhere?

On Friday, March 20, 2015 at 2:40:28 PM UTC-4, Igal wrote:

the /conf/web.xml is a Tomcat path, not Jetty.

in both engines (as well as any other servlet engine) you can
place a web.xml in your app's WEB-INF folder, so it would be
/{your-web-context}/WEB-INF/web.xml -- it will, of course, have to
be valid as per the Servlet specification.

otherwise, in Jetty, you can simply modify webdefault.xml, which
is equivalent to {Tomcat}/conf/web.xml

if you don't know what you're doing then definitely make a
backup.  if you know what you're doing then also make a backup ;)

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 3/20/2015 11:31 AM, Terry Whitney wrote:
In \were-ever-you-extracted-lucee-express-installer\conf\ is
where you will find web.xml


I would make a backup copy of that file before you attempt to do
anything else.




On Friday, March 20, 2015 at 12:37:17 PM UTC-4, Jonathan Brookins wrote:

    I've been trying to add gzip compression for javascript and
    css files on my local machine which is using Jetty with no
    success.  I read
    this http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
    <http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html>
    but I cannot find a web.xml file, although there is a
    webdefault.xml which looks promising.  When I add that filter
    block into the file nothing works.  It crashes with a 503
    Service Unavailable.  The lucee console shows no error
    messages, and I cannot find any jetty logs.  Anyone have any
    ideas on my debugging of the Jetty issue, or has this already
    setup?  Thanks!

-- 
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+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com
<javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/8c0ff9cf-1284-4e43-8601-92148133f9d9%40googlegroups.com
<https://groups.google.com/d/msgid/lucee/8c0ff9cf-1284-4e43-8601-92148133f9d9%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.


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
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/e6ee39e2-3158-4f49-b28f-52be49f76b82%40googlegroups.com
https://groups.google.com/d/msgid/lucee/e6ee39e2-3158-4f49-b28f-52be49f76b82%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

I’m pretty sure that this list is not complete, but it probably covers
most Servlet containers:

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/On 3/20/2015 11:56 AM, Terry Whitney wrote:

Sorry about that.

Only how many web servers are there?

:slight_smile:

I would run an override as described here, as it seems like the
cleaner approach.
http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/override-web-xml.html

On Friday, March 20, 2015 at 12:37:17 PM UTC-4, Jonathan Brookins wrote:

I've been trying to add gzip compression for javascript and css
files on my local machine which is using Jetty with no success.  I
read
this http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html
<http://www.eclipse.org/jetty/documentation/9.1.2.v20140210/gzip-filter.html>
but I cannot find a web.xml file, although there is a
webdefault.xml which looks promising.  When I add that filter
block into the file nothing works.  It crashes with a 503 Service
Unavailable.  The lucee console shows no error messages, and I
cannot find any jetty logs.  Anyone have any ideas on my debugging
of the Jetty issue, or has this already setup?  Thanks!


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
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/d8414c9c-d84c-41f9-8aaa-f3853f4667c9%40googlegroups.com
https://groups.google.com/d/msgid/lucee/d8414c9c-d84c-41f9-8aaa-f3853f4667c9%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

Here is the filter block XML. I added it to my webdefault.xml above the
default context stuff. You could also add it to web.xml if you only want
to run it for that context. If you go the web.xml route make sure the file
is proper XML.

GzipFilter org.eclipse.jetty.servlets.GzipFilter methods GET,HEAD mimeTypes text/html,text/css,text/plain,text/xml,application/javascript GzipFilter /*

On the default context parameters you will need to turn on gzip.

gzip true

When asking questions about Jetty it is better to use the jetty user
mailing list.

Andrew Penhorwood>>

Jonathan wrote:

This is just on my development laptop.

Well the point of gzip is to compress files for faster network transfer.
If there’s no real network involved, there’s likely no benefit doing it.
(Other than the educational benefits of learning how it’s done.)

The Jetty version is 9, the install
is whatever the original Railo install did.

You presumably mean Jetty 9.1.5 that came with Railo Express 4.2.1?

If someone asks a version number, always specify at least major.minor,
and there’s no harm in giving the full major.minor.patch.build version.

You can get these values for any Lucee/Railo server by dumping server
scope.

Anyhow, to enable gzip for static files you need to do two things:

  1. Add the filter and filter-mapping config to etc/webdefault.xml

  2. Add “–module=servlets” to start.ini

This second step enables Jetty to find the GzipFilter class (which is
in jetty-servlets.jar and only loaded if servlets module is enabled).

That works on the above mentioned versions - if it still doesn’t work
for you we’ll need to either turn on logging to find out why, or just
use a fresh setup (which is probably the easier/better route if you
don’t have any customisations to keep).

Andrew wrote:

On the default context parameters you will need to turn on gzip.

gzip true

That parameter doesn’t turn on gzip, it turns on looking for
already-gzipped files.

So if the request is for /styles.css and there is a /styles.css.gz file
then Jetty will send the latter in response.

Saves the overhead of compressing the file at request time, so a useful
final step if a CSS pre-processor is used, but otherwise it’s probably
annoying to have to keep the file in sync when changes are made.

When asking questions about Jetty it is better to use the jetty user
mailing list.

And when suggesting someone to use another mailing list, it’s useful to
point them at it. :stuck_out_tongue:

https://dev.eclipse.org/mailman/listinfo/jetty-users

As a sitenote, if you use .cfm as extension for your css/js files
(style.css.cfm) Lucee is processing this requests and you can simply enable
gzip compression in the lucee admin.

MichaAm Sonntag, 22. März 2015 schrieb Peter Boughton :

Andrew wrote:

On the default context parameters you will need to turn on gzip.

gzip true

That parameter doesn’t turn on gzip, it turns on looking for
already-gzipped files.

So if the request is for /styles.css and there is a /styles.css.gz file
then Jetty will send the latter in response.

Saves the overhead of compressing the file at request time, so a useful
final step if a CSS pre-processor is used, but otherwise it’s probably
annoying to have to keep the file in sync when changes are made.

When asking questions about Jetty it is better to use the jetty user
mailing list.

And when suggesting someone to use another mailing list, it’s useful to
point them at it. :stuck_out_tongue:

https://dev.eclipse.org/mailman/listinfo/jetty-users


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 <javascript:;>.
To post to this group, send email to lucee@googlegroups.com <javascript:;>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/20150322194513.00006261%40sorcerersisle.com
.
For more options, visit https://groups.google.com/d/optout.