TLDR; on our sites we don't use the "Allow content to be redirected?" option. Adding the option to remove this functionality completely will save 30-50ms per uncached request.
According to our New Relic instance, the match_redirect module is the most time consuming module we have on a few of our high traffic sites. This makes sense when you consider what it's doing, but I'm looking for ways we can save some time. If we add something like this to match_redirect_init:
function match_redirect_init() {
if (variable_get('match_redirect_never_redirect_content', FALSE) && match_redirect_url_exists()) {
return;
}
it seems to save around 30-50ms of time -- it's difficult to see the savings through a benchmark, but if you do a simple microtime print inside the init you can see what's being saved (make sure page caching is turned off).
Does this seem like a reasonable approach? It's kind of an advanced option, so hiding it away in a variable makes sense to me.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | match_redirect-skip-content-redirects-2827677-2.patch | 1.14 KB | daniel.nitsche |
Comments
Comment #2
daniel.nitsche commentedFirst attempt at a patch
Comment #3
daniel.nitsche commented