The slowness of PM is caused by DB slowness. (It's IO from the point of view of the web server. I don't know if it's CPU or disk from the point of view of the DB server, so I hesitate to call it "IO" without further specificis.) And actualy,your idea would cause a check if the cached version of downloadcode is up to date for each note displayed. But that's very minor compared to the overhead of displaying a new (full) page.
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).