If an application modifies an item whose item descriptor specifies distributed TCP caching mode, a cache invalidation event is broadcast from that ATG instance to all other ATG instances that use distributed TCP caching. The event message supplies the nature of the change, the changed item’s type, and repository ID. Receiving repositories respond by invalidating that cached item.
Distributed TCP caching is suitable for sites where the following conditions are true:
Items of a type that specifies distributed TCP caching are likely to be cached across most ATG instances in the application.
Items are subject to frequent reads.
Items are rarely changed, added or deleted.
An item that changes frequently—say, more than 50 or 100 times per second —is not suitable for distributed TCP caching mode, because the extra network activity incurred by cache invalidation messages outweighs caching benefits. Cache invalidation events are broadcast to all ATG instances that enable distributed caching, even if they do not cache the invalidated item; as the number of these ATG instances increases, so too increases the network activity associated with each cache invalidation event.
Implementation
Distributed TCP caching is implemented by the following elements:
Cache invalidation events of class
atg.adapter.gsa.event.GSAEvent
convey cache changes to other ATG instances, identifying the event type, item descriptor name, and repository ID.Event server components of class
atg.adapter.gsa.event.GSAEventServer
send and receive cache invalidation events over TCP among participating ATG instances. All repositories in an ATG instance reference the same event server. When instantiated, the event server opens up a server socket on the specified port or, if unspecified, on one that is randomly assigned.gsa_subscriber_table
maintains routing information for each item descriptor that uses distributed TCP caching: its repository path, and the address and port of that repository’s event server. When a change occurs on one ATG instance to an item that uses distributed TCP caching, its repository usesgsa_subscriber_table
to look up the same item descriptors on other ATG instances. It then generates a cache invalidation event with their routing information.