0

clearup component cache after page closed

asked 2019-09-09 09:24:18 +0800

xuesong gravatar image xuesong
101 1

when zul'page close ,uuid of componenets in the server should clearup. zul'page opens again, all of its components should be created again too. how to do this?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-09-09 17:43:50 +0800

MDuchemin gravatar image MDuchemin
1416 1 5
ZK Team

Hi there Xuesong,

Not quite sure which cache you are refering to. What you described is the standard for zul pages (unless you already have some customization in place).

The expected lifecycle is: - User request page - Page initializes components - Components are kept in memory in the "desktop" object (which itself is located in the HttpSession) - User interact with the page, send events, receives updates. (the server will update the components stored in "desktop" object, and send relevant requests) - User closes the page / refresh the page / navigates away / user session expires: the desktop object is not freed and will be cleaned by the Java garbage collector, which includes every component located in the desktop.

Regarding UUIDs: Uuids are indentifiers, which are generated by the UuidGenerator class. Uuids MUST be unique inside of a rendered page (inside of a desktop), but can be recycled between contexts. They don't have effect on caching though, they are just identifiers for components. With UuidRecycling enable, once a component is destroyed, it's Uuid may be reused.

See here for more info on UuidGenerator and UuidRecycling

You can create a custom generator to always get the same UUIDs for the same components in the page if that's the target (for testing). By default, you should get random IDs on comps.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2019-09-09 09:24:18 +0800

Seen: 5 times

Last updated: Sep 09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More