# Request for Review: nginx module to strip whitespace from served pages

**URL:** <https://www.ruby-forum.com/t/request-for-review-nginx-module-to-strip-whitespace-from-served-pages/205275>\
**Category:** NGINX\
**Created:** [April 2, 2011, 4:27pm UTC](https://www.ruby-forum.com/t/request-for-review-nginx-module-to-strip-whitespace-from-served-pages/205275 "2011-04-02T16:27:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [April 2, 2011, 4:27pm UTC](https://www.ruby-forum.com/t/request-for-review-nginx-module-to-strip-whitespace-from-served-pages/205275/1 "2011-04-02T16:27:16Z")

</div>

Hi All,

I’ve written a module to strip whitespace from text served by nginx in  
order  
to reduce bandwidth consumed. I’m currently testing my module on a  
staging  
server with nginx 0.7.67. However, since this is the first nginx-module  
that  
I’ve written, I would be grateful if someone could review my code and  
point  
out any mistakes I might have made from ignorance/inexperience.

The code for my module is at [GitHub - vedang/nginx-nonewlines: This is an nginx module to strip the served HTML of all newlines (\n and \r characters)](https://github.com/vedang/nginx-nonewlines).  
I  
have based it on a function used by reddit, the code for which can be  
found  
here:  
[https://github.com/reddit/reddit/blob/master/r2/r2/lib/c/filters.c#L216](https://github.com/reddit/reddit/blob/master/r2/r2/lib/c/filters.c#L216).  
Any  
suggestions would be highly welcome. Thanks!

–  
Unix is simple. It takes a genius to understand it’s simplicity. -  
Anon  
People think it must be fun to be a super genius, but they don’t realize  
how  
hard it is to put up with all the idiots in the world. - Calvin.

Cheers,  
Vedang.

Software Developer,  
Infinitely Beta.  
[http://twitter.com/vedang](http://twitter.com/vedang)  
[http://vedang.me](http://vedang.me)
