Client hint configuration header

I was reading the documentation on client hints.
I’m serving my website with php, but cache as .html is there a way to add these headers? With Apache? Or is that not really needed?

I’m using a subdomain (dash.zwemindex.nl), so how do I change the header in this context?

We’ll definitely need to improve the documentation on this topic. Right now, you should use the domain the traffic is sent to. So if you’re using a custom domain, replace pirsch.io with that.

There is a ticket for it. More documentation, testing if this actually works as intended, and so on. We’ll announce it in the news :slight_smile:

1 Like

Thanks
I set the header like this but I get a permissions policy error:

Header always set Permissions-Policy “ch-ua=(self ‘https://dash.zwemindex.nl’), ch-ua-mobile=(self ‘https://dash.zwemindex.nl’), ch-ua-platform=(self ‘https://dash.zwemindex.nl’), ch-ua-platform-version=(self ‘https://dash.zwemindex.nl’), ch-width=(self ‘https://dash.zwemindex.nl’), ch-viewport-width=(self ‘https://dash.zwemindex.nl’)”

Any clue?

What error do you get? I think that should be correct, the single ticks might be the issue (‘ instead of ').

I checked (I thought the ticks were added in the forum, but they came from copy-pasting from the documentation page). In visual studio code the ’ was shown, but to be sure I replaced them manually again. I still get the error.

Header always set Permissions-Policy "ch-ua=(self 'https://dash.zwemindex.nl'), ch-ua-mobile=(self 'https://dash.zwemindex.nl'), ch-ua-platform=(self 'https://dash.zwemindex.nl'), ch-ua-platform-version=(self 'https://dash.zwemindex.nl'), ch-width=(self 'https://dash.zwemindex.nl'), ch-viewport-width=(self 'https://dash.zwemindex.nl')"

Error message:

Error with Permissions-Policy header: Parse of permissions policy failed because of errors reported by structured header parser.

Ok, solved it. The policy should have double quotation marks instead of single.

This is the line in .htaccess that works (escaped double quotes):

Header always set Permissions-Policy "ch-ua=(self \"https://dash.zwemindex.nl\"), ch-ua-mobile=(self \"https://dash.zwemindex.nl\"), ch-ua-platform=(self \"https://dash.zwemindex.nl\"), ch-ua-platform-version=(self \"https://dash.zwemindex.nl\"), ch-width=(self \"https://dash.zwemindex.nl\"), ch-viewport-width=(self \"https://dash.zwemindex.nl\")"

1 Like

Glad that you were able to solve it! :+1: