Page trace middleware