I see a very simple solution to all this cacheing. Store the uninterpreted magic word in the cache, and replacing it with the user's name on ultimate page-display with a very quick pass.
This means that the magic word can't be used in any kind of {{#ifeq:}} formulation, or suchlike, but it CAN be used in any transclusionary way e.g. "Hello John Doe, welcome to Wikipedia", or "You are logged in as John Doe" or "Go to [[User:John Doe]] to see your userpage" or "Go to [[Main Page/John Doe]] for your personalised homepage", etc. i.e. In any place where the usage of {{USERNAME}} actually outputs the username it will work (the raw code "{{USERNAME}}" will simply be thrown about through templates and outputted, then swapped at load time).
This means that any usage such as {{#ifeq:{{USERNAME}}|John Doe|Hey man}} will interpret "{{USERNAME}}" as a literal string, but any usage such as {{template|data|{{USERNAME}}}}, which simply moves the parameter to a point inside an infobox, or something, will (although strictly still treating the string literally), ultimately be replaced with the current username on load time.
On 13/11/2007, Roan Kattouw roan.kattouw@home.nl wrote:
Anthony schreef:
Either you've figured out how to cache part of the content while keeping another part dynamic
We have. It's called the parser cache.
or you don't cache logged in users anyway.
Since user preferences (show/hide TOC, section numbers, date format, etc.) vary, the first view of a page is probably not cached. Any subsequent view would be cached, until the page (or a template it transcludes) is edited. That's no problem for {{USERNAME}}, though.
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l