While I am working on the TWikiCache I just found out that the current twisties as they are produced by the
TwistyPlugin &
TwistyContrib, can't be cached as part of the complete html page. That's because the
TwistyPlugin reads the browsers cookies and then generates specific html for it ... which is fine for the first hit on a page. But the markup produced by the plugin is then stored to the TWikiCache and reused on further calls on the same page by the same user. After loading the page, the user just changed the state of some twisties in his browser and reloads the same page again and thus gets the cached page...which has got the former classes inside the twisty controls based on the first call to that page. The
TwistyPlugin will not see this second request and the changed cookies as the rendering engine is avoided on subsequent calls on the same page.
I know the TWikiCache is not coming out for TWiki-4.2, but I still would like to discuss this issue in time. Arthur, any ideas?
--
TWiki:Main/MichaelDaum
- 25 Jul 2007
Is there any way javascript can find out the page is cached? Or
TwistyPlugin at the time of writing the js?
--
TWiki:Main.ArthurClemens
- 26 Jul 2007
Every page is cached. You can exclude sections of a page from being cached and rendered on request time. But that's not what you want for twisties, do you.
--
TWiki:Main.MichaelDaum
- 27 Jul 2007
I am looking for a way to let the plugin write the initial state only when the page is not cached.
--
TWiki:Main.ArthurClemens
- 27 Jul 2007
What about pages that are cached and have twisties on them? All of my pages have twisties.
--
TWiki:Main.MichaelDaum
- 28 Jul 2007
The problem with VarCachePlugin appears to be missing head files
Item5414.
--
TWiki:Main.ArthurClemens
- 03 Mar 2008
Can't see that this is related to TWikiCache as it caches all of the page as it was send to the browser the first time.
The problem - described above - is a fundamental one: the user changes a cookie state via javascript, but gets the same page again with the old twisty states, and these don't match the cookie states anymore. That's because the
TwistyPlugin does not get a chance to read them anew on perl level.
--
TWiki:Main.MichaelDaum
- 04 Mar 2008
Would it be better if the cookie is optionally read with js only?
--
TWiki:Main.ArthurClemens
- 04 Mar 2008
Yes, I think so.
TwistyPlugin did so once, didn't it?
--
TWiki:Main.MichaelDaum
- 05 Mar 2008
Yes, we added reading cookies by perl to prevent having "init" js tags right after the twisty html (to prevent visually disturbing opening/closing of twisties). Problem is that twisties are default open as no-js fallback. Perhaps we can find another mechanism for that.
--
TWiki:Main.ArthurClemens
- 05 Mar 2008