That's not enough - you need to know when the tables used to build the dynamic page were last updated, not just when the script and template files were last modified.
This is a problem I've been thinking about recently. There's no easy way to cache some types of query information in [Open]ACS 4 - multirow, in particular. This was easy in [Open]ACS 3 and earlier.
Rather than beating my head against that problem I've been thinking in terms of doing caching of the dynamic page that's generated itself, as you have, apparently.
I've got some ideas but won't have time to explore further until we start our next release cycle.