Subpages not cacheable in Nginx environment

On an nginx server I have the strange problem that subpages are not cached. The home page gets cached.
I already found out that $request->data() in the isCacheable() function is not empty for the subpages - see kirby/src/Cms/Page.php at b7b9862a240e789cebff5af04f4d9ff10f73d7e0 · getkirby/kirby · GitHub

$request->data() for the home page returns:
array(0) { }

Example $request->data() for a subpage returns:
array(1) { ["/company"]=> string(0) "" }

But I have no idea why $request->data() is not empty in this case. Does anyone have any idea why this is happening?

Are you calling the subpages with any query strings?

No there are no visible query strings, but I realized some interesting Request Headers (:authority :method :path and :scheme) in this environment. See: Hypertext Transfer Protocol version 2.0

So for example for a subpage the values are

:authority: domain.de
:method: GET
:path: /unternehmen
:scheme: https

Maybe the :path request Headers causes $request->data() not to be empty? But i think i’m not able to remove these kind of request headers.

Looks like it. But I’m afraid I cannot help with that.

Ok. I could not found if it had to do with the pseudo-header :path in h2 environment. So the URL did not contain any visible GET parameters. So I think it has to do with the :path request header. For me it made absolutely no sense to have $_GET param that is equal to the current URL path. So I was able to get around this by a kirby hook:

<?php

return [
    'hooks' => [
        'route:before' => function () {
            $path = strtok($_SERVER["REQUEST_URI"], '?');

            if (isset($_GET[$path])) {
                unset($_GET[$path]);
            }
        }
    ]
];

I think we should open an issue. I have another project where the exactly same behaviour happens on h2-server, because of the :path Request Headers.

Go ahead!