openresty

OpenResty

Specific best practices and architectural patterns when working with OpenResty.

Details

Language / Topic
luaLua
Category
framework

Rules

balanced
- Execute Lua logic extremely efficiently binding functions directly within `content_by_lua_block` Nginx configuration directives.
- Fetch database data asynchronously running `lua-resty-mysql` or `lua-resty-redis` modules explicitly avoiding blocking operations.
- Cache frequent responses dynamically utilizing `lua_shared_dict` configuring fast local memory sharing across Nginx workers.
- Parse incoming JSON payloads natively linking `cjson.decode` cleanly returning standard Lua table structures.