Average generation Time is really short

Hi all

The average generation times shows just numbers under 0.4 s mostly also under 0.1 s
When I load a site it mostly takes multiple seconds to load. Tested it also on other good computers and they always had like 2 seconds to load.

The generation time is obivously wrong. What can I do that the generation time will show correct.

Hi,

Matomo just calls the browser performance API and stores the returned value.

So you can check the value yourself by entering the following in the JavaScript console.

window.performance.timing.responseEnd-window.performance.timing.requestStart

I think responseEnd is only after the main HTML file has loaded, but what you are thinking of is how long the whole page (including CSS, JS, Images) to load.

Thanks - is it possible to change the generation time through this time?
window.performance.timing.responseEnd-window.performance.timing.requestStart

I am not sure what you mean.

This is the line in piwik.js that stores the data:

And here you can learn more about the performance API:

I think window.performance.timing.domComplete is a bit more of what you imagine (the time when a page has finished loading everything.

@Lukas
If I execute this line:
window.performance.timing.responseEnd-window.performance.timing.requestStart

It shows me a time which is true - mostly it shows something around 1000 ms. But on Matomo the numbers are much lower than the real loading time.

So the average generation time in Matomo is not equal to the returning value of this js line.
How can I fix this?

Are you understanding my problem?

I’m pretty sure Matomo does nothing else with this value. (as you can see in the code above)

But maybe some browsers are visiting your website that return an invalid number for that. Or as said before this probably only records the time of the main HTML file and if visitors are able to cache it, it will be much faster.