Web / Apache OFBiz Interview questions
How does OFBiz cache entity data, and when should the cache be cleared?
The Entity Engine keeps several in-memory caches - by primary key, by query condition, and for entire lists - keyed per delegator, so repeated reads of reference data (like a status or product-type list) avoid hitting the database every time.
Caching is configured per entity and is most valuable for slow-changing, frequently read data; it's usually left off or short-lived for fast-changing transactional entities like orders.
The cache must be cleared whenever data changes outside the normal service/entity-write path that would normally trigger an automatic clear - after a direct SQL update, a bulk import, or when running multiple OFBiz instances behind a load balancer, where Distributed Cache Clear (DCC) is needed to notify every node.
WebTools includes a "Cache Maintenance" screen to manually inspect and clear specific caches when troubleshooting stale data.
More Related questions...