[Templates] Show time it took to generate page?

I’m building a simple website using Caddy’s template functionality and was wondering if there is an undocumented variable that reveals the time it took to generate a page. This was quite common to print at the bottom of pages in the 90’s and 2000’s when PHP was all the rage :grin:

I’m using the latest version of Caddy on linux, but I guess my systems details are less relevant for this question?

1 Like

There’s a few “system” placeholders available here:

But none of those give you the time at the start of the request. We could probably add something like that though. Then you could do the math in your template to calculate the difference from that to now.

/cc @matt

2 Likes

Ah that 90’s nostalgia is strong. Yeah we can add that I think. Want to open a feature request on GitHub? Sign in to GitHub · GitHub

1 Like

Thanks for considering adding this! I opened an issue over at Github :+1:

3 Likes

Ahh silly me, there’s already {http.request.duration} (and variant duration_ms) which tells you how long the request has been going for.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.