Welcome! Log In Create A New Profile

Advanced

map to use regex or not

Reinis Rozitis
May 31, 2017 02:14PM
Hello,
I have a setup where I need to override backend's content type and was wondering which approach (without too much digging into source and/or doing microbenchmarks) is better (less cpu) from performance point of view?


map $uri $custom_content_type {
hostnames;
*.jpg "image/jpeg";
}

or with regex

map $uri $custom_content_type {
~\.jpg$ "image/jpeg";
}


(in general just for theoretical knowledge since the difference as I imagine is most likely very minimal/unnoticable)

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

map to use regex or not

Reinis Rozitis May 31, 2017 02:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 285
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready