Widget cache is working?

Added by Marcelo Saldanha 4 months ago

Hi,

Does anybody knowns if the widget cache is working properly? I'm trying something here that indicates it is not, or else I'm doing it wrong.

If I understood it correctly, Diem have several cache levels:
- Super-cache, which involves Apache and a .html page saved on disc (I think this is from symfony, but I don't use it, anyway)
- Page-cache, which caches a entire page and does not runs the action's execute method (no zone/widget selection or execution)
- Widget-cache, where Diem selects zones and widgets from DB, but does not run the widget's execute method
- Custom-cache, where the programmer implement cache as he wants (dmWidgetTwitterPlugin uses this, for example)
- Opcode/config cache, which is used internally

The opcode/config cache (using APC), is working fine. The custom caches are too. Super-cache I don't need, and page-cache, when I tested it, was working fine too (I saw the lighting icon and the server throughput increased a lot). The problem with page-page is that my site has some dynamic parts that interfere with it. Mainly, a login widget (which reacts to the logged user, or prompts a login form and handle it) and a session-base widget (it displays a banner only once per session). When using page-cache, these widgets are not processed, and that made login/logout impossible, and the banner was shown every time.

The widget cache, on the other hand, does not appear to be working. I see no sensible difference whether it is enabled or not, and although the login widget works, the session-based one does not, in the same page (I have disabled widget cache on both).

I tried to debug and see where the cache logic fails, but got lost in the code...

If someone have a solution for this kind of problem, please share it. I think I can provide a test project, if necessary.

Thanks!


Replies (3)

RE: Widget cache is working? - Added by Kye Etherton 4 months ago

The widget cache works in modules.yml with the settings of true, false, and static. My advice is to use true for any show widgets, else you sometimes get error on page:true modules, and to use static for the lists. widget-cache DOES call actions.class.php but NOT components.class.php

This means forms and data should still be processed, but the actual HTML of the component is pulled from the cache.

RE: Widget cache is working? - Added by Marcelo Saldanha 4 months ago

Kye, if some condition in the action's code result in changes in the html, how could the cache be invalidated?

(1-3/3)