So I threw this together I hope some people will help and contribute to my regex to improve it.https://github.com/C0nw0nk/Nginx-Lua-minification-libraryI was inspired by cloudflare. Thank you @Cloudflare for the love <3 :) .
Nice!A few thoughts:- Using regular expressions for HTML parsing is always a Bad Idea :D might be better to use a saner DOM parser- If you are going to keep using regexes, try to replace greedy quantifiers with lazy ones to reduce backtracking- Consider using "ngx.re.*` APIs instead of string.gsub, which cannot be JITed- Consider using integer-based array access instead of ipairs, which might have a performance/JITability improvementOn Tue, Nov 27, 2018 at 8:25 PM c0nw0nks via openresty-en <openresty-en@googlegroups.com> wrote:So I threw this together I hope some people will help and contribute to my regex to improve it.https://github.com/C0nw0nk/Nginx-Lua-minification-libraryI was inspired by cloudflare. Thank you @Cloudflare for the love <3 :) .