NSAPI Trim Filter

General info

Trim Filter is a NSAPI plugin/filter which removes unnecessary whitespaces from HTML code. It reduces size of documents sent to client browser. It can be really useful to remove lots of tabs and other whitespaces from jsp generated HTML pages. Trim Filter does not filter <pre> and <textarea> tags to preserve original content.

Originally I wrote this as a proprietary software but this version is rewritten and now it is GNU LGPL.


After compilation You have to modify magnus.conf (put it in one line):

Init fn="load-modules" shlib="/usr/iplanet6.1/plugins/trim/" NativeThread="no"

and obj.conf to enable filtering (also in one line):

Output fn="insert-filter" type="text/*" filter="nsapi_trim_filter"

For detailed instructions please go to the README file


sources: trim_filter-0.6.tar.gz see ChangeLog for details.





For 80kb html page it takes less than 1 ms to trim it. I did some benchmarks with ab and the results are here.

I am using non-LGPL version on big site with few iPlanets on front, serving few millions pages every day and I did not found any performance issues.

Bugs & comments

If You found bug or have comments, please let me know.


Trim Filter plugin is licensed under GNU Lesser General Public License (LGPL). See COPYING file in sources package for details.