7 ms·
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?
by yellow 12y ago
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?
- abedra 12y agoThe intent was to demonstrate how to write a module in C. This can be solved with Lua as well.
- yellow 12y agoI 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!
- justincormack 12y agoUsing Lua is much easier. Performance is unlikely to be a bottleneck. Developing a module is a real pain and a last resort.
- abedra 12y agoUsing 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.