If enable in nginx gzip_static on and create precompressed files .gz and send request
curl https://example.ru/bitrix/js/ui/bootstrap4/css/bootstrap.min.css -I -A curl-Gzip -H 'Accept-Encoding: gzip'
If remove from nginx open_file_cache max=2048 inactive=20s;
And send request
curl https://example.ru/bitrix/js/ui/bootstrap4/css/bootstrap.min.css -I -A curl-Bortli -H 'Accept-Encoding: br'
Then Response:
diff -ruN orig/static/ngx_http_brotli_static_module.c my/static/ngx_http_brotli_static_module.c
--- orig/static/ngx_http_brotli_static_module.c 2020-04-23 13:55:31.000000000 +0300
+++ my/static/ngx_http_brotli_static_module.c 2020-07-23 18:37:00.978000000 +0300
@@ -178,7 +178,9 @@
if (last == NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR;
/* +1 for reinstating the terminating 0. */
ngx_cpystrn(last, kSuffix, kSuffixLen + 1);
- path.len += kSuffixLen;
+ /* Kuka Patch for work with open_file_cache like gzip_static */
+ path.len = last - path.data;
+
log = req->connection->log;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http filename: \"%s\"",
compile dynamic module and check again with settings nginx `open_file_cache max=2048 inactive=20s;`
Sent request:
`curl https://example.ru/bitrix/js/ui/bootstrap4/css/bootstrap.min.css?1595419624140936 -I -A curl-Bortli -H 'Accept-Encoding: br'`
Then response:
100% every time like gzip_static
8. But there is the problem with my patch. If I add `open_file_cache_errors on;` setting to nginx and request html page with many resources
then sometimes I got 404 error for resources (.png).
If I set `open_file_cache_errors off;` the everything works fine.
Hello!
Created precompressed files .br
Set in nginx
Sent request:
curl https://example.ru/bitrix/js/ui/bootstrap4/css/bootstrap.min.css -I -A curl-Bortli -H 'Accept-Encoding: br'
and got responsebut if you check response several times:
and so with a probability of 50%
If enable in nginx gzip_static on and create precompressed files .gz and send request
curl https://example.ru/bitrix/js/ui/bootstrap4/css/bootstrap.min.css -I -A curl-Gzip -H 'Accept-Encoding: gzip'
Then get response
100% every time.
If remove from
nginx open_file_cache max=2048 inactive=20s;
And send requestcurl https://example.ru/bitrix/js/ui/bootstrap4/css/bootstrap.min.css -I -A curl-Bortli -H 'Accept-Encoding: br'
Then Response:100% every time
Ok. I created patch
HTTP/2 200 server: nginx date: Fri, 24 Jul 2020 06:34:50 GMT content-type: text/css content-length: 15812 last-modified: Wed, 22 Jul 2020 12:07:04 GMT etag: "5f182be8-3dc4" content-encoding: br expires: Fri, 31 Jul 2020 06:34:50 GMT cache-control: max-age=604800