Hacker News new | past | comments | ask | show | jobs | submit login
Nginx Tutorial: Developing Modules (airpair.com)
141 points by aerosmile on July 28, 2014 | hide | past | favorite | 12 comments



I would also like to see this approach in Lua by comparison. I find the performance loss negligible compared to the ease of writing / debugging Lua.


In a cursory glance, this appears to be logic (token, redis, etc) that can be handled by Nginx+Lua. Is there any reason to do it this way vs the other?


The intent was to demonstrate how to write a module in C. This can be solved with Lua as well.


I was hoping for a performance related answer, but you are right. I might walk through this and see if one way is faster than the other. Thanks!


Using Lua is much easier. Performance is unlikely to be a bottleneck. Developing a module is a real pain and a last resort.


Using Lua is certainly easier. The C version will almost always be faster, and yes, performance in this scenario probably wouldn't be an issue between the two. The other reason for writing a module in C though is complete control over the execution and an easier time troubleshooting problems. Adding another language layer can present issues when things explode.


I love how this tutorial starts by writing an automated integration test. More tutorials should do this. A fine job. Have a cookie.


Excellent tutorial, thank you for posting. All tutorials should be this complete.


thanks for this. It came in just at the right time as I was looking into this.


Thanks for the video.


This looks awesome!


awesome video!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: