# Static ETags

**URL:** <https://www.ruby-forum.com/t/static-etags/217930>\
**Category:** NGINX\
**Created:** [March 16, 2012, 4:29pm UTC](https://www.ruby-forum.com/t/static-etags/217930 "2012-03-16T16:29:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 16, 2012, 4:29pm UTC](https://www.ruby-forum.com/t/static-etags/217930/1 "2012-03-16T16:29:28Z")

</div>

Hi Everyone,  
I had a look at the Static Etag 3rd party module, and noticed a few  
things:

1. There is a memory leak, a malloc() requesting 1000 bytes is called,  
but never free()'d
2. Doesn’t check headers from client to see if there is a  
“If-None-Matched:” header, so all it does is generate etags, never  
checks
3. Not very robust.

I’ve written the author Mike W. a couple of times but got no reply. So  
I took it upon myself to fix. Below is the github with the fixed  
version. This is my first nginx module, so please critique as much as  
you can. I’m still getting acquainted with the code.

> **[GitHub - trojan2748/NginX-Etags: Static Etags for NginX](https://github.com/trojan2748/NginX-Etags)**
>
> Static Etags for NginX. Contribute to trojan2748/NginX-Etags development by creating an account on GitHub.

Posted at Nginx Forum:

> **[Static ETags](https://forum.nginx.org/read.php?2,223971,223971#msg-223971)**
>
> Hi Everyone, I had a look at the Static Etag 3rd party module, and noticed a few things: 1) There is a memory leak, a malloc() requesting 1000 bytes is called, but never free()'d 2) Doesn't check headers from client to see if there is a...

---

<div class="post-metadata">

**Author:** ![trojan2748](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c4cdca/32.png) [@trojan2748](https://www.ruby-forum.com/u/trojan2748)\
**Post date:** [March 16, 2012, 5:14pm UTC](https://www.ruby-forum.com/t/static-etags/217930/2 "2012-03-16T17:14:13Z")

</div>

On Friday 16 March 2012 19:29:02 trojan2748 wrote:

> I’ve written the author Mike W. a couple of times but got no reply. So  
> I took it upon myself to fix. Below is the github with the fixed  
> version. This is my first nginx module, so please critique as much as  
> you can. I’m still getting acquainted with the code.
> 
> [GitHub - trojan2748/NginX-Etags: Static Etags for NginX · GitHub](https://github.com/trojan2748/NginX-Etags)

A cursory examination shows a large number of problems with the code.  
But  
the most serious one is that your module just block nginx on fread(),  
which  
will completely kill the performance.

wbr, Valentin V. Bartenev
