Default Gzip filter in web.xml currently not compressing application/javascript

I noticed that the gzip filter is set up to compress ‘application/x-javascript’, but not ‘application/javascript’. Changing it to compress application/javascript would affect the ol and mapml previews, and perhaps other stuff I’m not aware of.

Could we try to change this global setting and see what happens at least? I’m aware that doing this in the midst of the current testing woes is not advisable, but perhaps afterwards?

Advice below, thank you.

Peter Rushforth

Hi Peter,
yes you’re right, it’s not set up to compress application/javascript… and application/x-javascript is really old,
but so is that line in web.xml, which dates back to 17 years ago (as found in the geoserver-history repository):

https://github.com/geoserver/geoserver-history/commit/b4acd0efba78a2b8678096b88e521aa85c47013e

That’s around 2007… according to ChatGPT, usage of “aplication/x-javascript” became unnecessary in 2006
with RFC4329, but practical usage started to decline only a few years later, around 2010.

So… it’s a bit of legacy that has been sitting there since then. I’d just go ahead and remove the “x-” prefix instead.

I will give that a try and submit a PR. You never know what will break with global changes, and also what might break out where GeoServer is deployed. Thanks Andrea!