Context: Imagine that you have a standard CherryPy hello word app:
def index(self): return \"Hello world!\" index.exposed = True
An on_end_request custom tool may be what you want.