On Tue, Nov 24, 2015 at 5:09 PM, Graham Leggett <minf...@sharp.fm> wrote: > > A further optimisation - in many cases the fast path is really a case > sensitive string comparison, given that the vast majority of the time the > case being used is the case quoted in the spec. > > In other words, while mAx-AgE is valid, it is almost always max-age. > > Does it make sense to do a case sensitive comparison first, and then fall > back to case insensitive?
Not sure: if (!strcmp(h, "max-age") || ap_cmpcasestr(h, "max-age")) is likely to be a bit faster than a single ap_cmpcasestr() when it matches, but much slower when it does not. Regards, Yann.