• Hi @braekling,

    I noticed something strange when I switched the Piwik Mode from HTTP API to PHP API, in the plugin’s settings.

    When it’s using PHP API, I find that there are three extra HTTP headers added to the page, when I read the headers using a service such as https://redbot.org. The three extra HTTP headers are:

    Pragma:
    Expires:
    Cache-Control: must-revalidate

    They appear exactly as above. In other words, the Pragma and Expires headers have no value at all.

    But when I change the plugin back to using HTTP API, these three headers disappear completely (which is what I consider expected behaviour – they should not be there in the first place).

    Do you have any idea why these three headers are added, when I change the Piwik plugin to use PHP API?

    My Piwik installation is on the same server as WordPress, and everything else with the plugin works fine.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author braekling

    (@braekling)

    If you are using the PHP mode, some Matomo classes are included by WP-Piwik to handle the connection. For some reason, these classes set their own HTTP headers, so I also expect these three to be created there.

    Just to be sure, I checked the WP-Matomo source code – and as expected, no one of these headers is set by WP-Matomo.

    Thread Starter GermanKiwi

    (@germankiwi)

    Just to clarify – are you saying that these headers are set by some external Matomo classes and not by your plugin?

    Does that mean they’re out of your control? Is there anything I (or you) can do to change this behaviour with the headers?

    I’d like to be able to use the PHP mode, but I can’t when it’s generating conflicting headers like this. 🙂

    Plugin Author braekling

    (@braekling)

    Well, if(!) it’s caused by Matomo, these are no external Matomo classes, these are internal Matomo classes. 😉 The plugin does not set these headers, so you should have a look at Matomos source code or check your other plugins.

    If you identify where (and why) they are set as empty headers, you can take care of this. But first, you should ask the Matomo team if they know about the headers and if they can explain what’s happing there.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Empty HTTP headers added when using PHP API mode’ is closed to new replies.