[Typo3-dev] Plugin needs to be cached but sometimes not

Peter Niederlag niederlag at ikd01.de
Fri Nov 26 18:57:53 CET 2004


Hi,

Michael Stucki schrieb:
> Hi Christoph,
> 
> thanks for your suggestion.
> 
> 
>>Hmmm. Add a DB field containing an MD5 hash as of "ls -alR | md5sum" of
>>the directory (might be slow) and have that one written to the DB (upon
>>every n-th access to the page), if changed. Accordingly, copy the old
>>MD5 value to another DB field for comparison. If md5_cur and md5_old
>>don't match, run $GLOBALS["TFSE"]->set_no_cache();
> 
> 
> This won't work, because once the content object is cached as a USER cObj,
> it will no longer open any PHP scripts inside of your extension.
> 
> I just made a test for this. Renamed the pi1/ directory and reloaded the
> cached page. There were no errors, everything appears just as usual.
> 
> So the check must be done before but I have no idea if and how this is
> possible yet.


You probably need some checksum like christoph suggested at first?

a) adding a second pi2 as a USER_INT that does nothing but comparing 
current checksum with old one and then setting -> no_cache or not.

Of course you need two calls on the page then until it is 
cached/indexed.(assuming the checksum didn't change in beetween) :-<

Fairly quick and simple and most likely does the job.

b)
The wholy book by the gurus has some suggestions on cHash and USER_INT 
on page 527ff. so you could possibly make it a USER_INT and add a 
cHash_parameter yourself?
This is supposed to be used for different "versions" of a page but maybe 
provides a solution for you as well?

HtH,
peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *
http://www.typo3partner.net * professional services network *




More information about the TYPO3-dev mailing list