Thread:Extension talk:FlaggedRevs/Revisions remains the same even if included templates are changed

We are building a CMS around mediawki and we need to have signed logs of page readings, with the ability to freeze a page we can record the revisions number and it will "contain" the revision number of transcluded page

But I cannot find all the information I need

In order to make this "freeze" work there must be a add-on to the database, otherwise how can a page "know" which version of template to call? There might be another way, storing in the database the expanded text and forget about links So I wonder how does it work?