dachcom-digital / pimcore-i18n

Pimcore - i18n Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should x-default and alternate links be pushed via HTTP2?

alexej-d opened this issue · comments

Q A
Bug report? yes?
Feature request? no
BC Break report? no
RFC? no

It looks like the generated x-default and alternate links are pushed as weblinks when weblinks and HTTP2 are activated. I do not think this is on purpose. These two lines src/I18nBundle/EventListener/Frontend/HeadLinkListener.php#L72 and src/I18nBundle/EventListener/Frontend/HeadLinkListener.php#L76 should add 'webLink' => false to the extra param.

Would you like me to open a PR?

@alexej-d mhm, that's interesting. Do you have any screenshot of the rendered link?

In my tests, the webLink attribute only get's applied, if the webLink explicitly has been set.

Pimcore reference:

https://github.com/pimcore/pimcore/blob/e1408784d9d00901b19dfdded1fd6025f47bf6a4/lib/Twig/Extension/Templating/Traits/WebLinksTrait.php#L85

Check the Chrome network inspection tab – for example these are the links that are pushed on the /de route on our instance: image

@alexej-d, thanks! Still weird, in my case, no weblink will be pushed in the setup.

I tested the x-default link for example:

$this->headLink->appendAlternate($this->generateHrefLink($xDefaultUrl), false, false, ['hreflang' => 'x-default']);

Still no preloaded link. If I'm adding the weblink attribute:

image

than I'm also see the preloaded link:

image

However, I don't think it is wrong to add this attribute, if it helps! A PR would be great!

@solverat did you set this config?

framework:
    web_link:
        enabled: true

I presume this is the reason for this behaviour.

@alexej-d: Yes, that's also enabled on my site.

Merged, thank you @alexej-d