Re: Macros and Caching

Finn Smith <[email protected]>
Newsgroups gmane.comp.web.wiki.moin.devel
Message-ID <[email protected]>
On Apr 10, 2004, at 3:08 PM, Finn Smith wrote:
>
> First question: Currently, MoinMoin caches the output of the macro 
> when I need it to execute the macro every time (or at least every time 
> its action is executed). If you login, it sometimes still displays the 
> fields to login, and if you logout, it sometimes still displays the 
> logout button. Hitting "Refresh Cache" at the bottom of the page 
> always refreshes to the correct output of the macro. Is there anyway 
> that I can either
> (a) force the page the macro is on to never be cached?
> (b) force at least the output of the macro to never be cached
> or, the preferred option,
> (c) force the page to refresh its cache whenever the action 
> corresponding to my macro is executed? (i.e. the output really only 
> needs to be refreshed when the login/logout status of the user 
> changes)

I found this line and comment in macro/FootNote.py

Dependencies = ["time"] # footnote macro cannot be cached

I put this line into my macro and got the desired behavior. Problem 
solved (I think).

I still don't understand what the Dependencies variable does. I'll have 
to go over the code more closely to figure out why this stops the 
caching behavior. Any quick explanations are welcome.

-F



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.