Fix Cache-Control headers for files under img dir

The glob pattern did not work (probably issues with the negation).

RE2 (Google's high performance RegEx engine) does not support negation either, that's why it has to be expanded this way (negated character groups are supported).

Glob patterns are not matched against the leading slash, but regexes are (undocumented, but observed).

Relates to !43 and therefore ae3148337b (the behavior finaly matches the description).
This commit is contained in:
Vojtěch Káně 2020-10-10 10:48:53 +02:00
parent 9342033393
commit b0d578dbe4

View File

@ -26,7 +26,7 @@
] ]
}, },
{ {
"source": "!(img)/**/*.@(jpg|jpeg|png|webp)", "regex": "^/(?:[^i]|i[^m]|im[^g])[^/]*/.*[.](?:jpg|jpeg|png|webp)$",
"headers": [ "headers": [
{ {
"key": "Cache-Control", "key": "Cache-Control",