Header normalization
Hi, I'm looking for some guidance on Accept-Language and Accept-Encoding header normalization to avoid high cache key cardinality.
For encoding, I was thinking of something like:
map {header.Accept-Encoding} {accept} {
~br br
~gzip gzip
default *
}
request_header Accept-Encoding {accept}
And for Accept-Language I was looking at https://github.com/simia-tech/caddy-locale but it doesn't seem to work with caddy 2.
Do you have recommendations? Is this even necessary?
Hello @cdaguerre that's something I would like to implement in the cache-handler/souin but I didn't find a way to do that without impacting the performances.
Hi @darkweak If it helps, I wrote a locale normalization plugin for caddy 2 here: https://github.com/cdaguerre/caddy-locale
Using it with following config normalizes and overwrites the Accept-Language header.
locale en fr de {
header Accept-Language
}
But I have no clue of the performance impact... And for encoding, I'm more or less using what I pasted in the issue description above.