If an item descriptor uses distributed cache mode, then when an item is changed in one JVM, events are sent to all other JVMs which might be caching items of this type. These JVMs are given the type and ID of the item that was modified and then invalidate the cache entry for that item and any queries which might be affected (all queries which depend upon items of that type).

Distributed cache mode is suitable for situations where items will be read and cached frequently and modified infrequently. It is typically used for content that is cached by all JVMs participating in the cluster, but is not modified frequently. An item that is modified more than 50 or 100 times per second on a site is not suitable for distributed cache mode, because the additional network activity created by all the cache invalidation messages may outweigh the benefits of caching.

In distributed cache mode, servers that are caching items of a particular item type need to find each other. In the default configuration, this is done automatically. Each Repository component references a GSAEventServer. Each ATG instance has one GSAEventServer and each repository in a ATG instance references the same GSAEventServer. The GSAEventServer class is an extension of RequestServer and uses TCP communication (ip:port) to send and receive events.

ATG maintains a table in the same database as the data you are caching. This database table stores the IP address and port number of each server that is running with distributed cache mode for each particular item descriptor type. When an ATG application starts up, it adds itself to this table and when it is shutdown cleanly, it removes itself from this table. This table is named das_gsa_subscriber.

When an ATG server modifies an item with cache-mode="distributed" set on its item descriptor, it sends an event to all of the other servers registered in this table containing the ID of the item and the item descriptor name.

In this default configuration, you don’t need to do anything to use this particular mode except to ensure that the das_gsa_subscriber table has been properly created in your database. Each ATG server listens on a randomly assigned port chosen by the operating system (guaranteed to be available). As described above, the database is used to communicate this information from one server to the next so that each ATG server can find all of the other ATG servers that cache a particular item type.

 
loading table of contents...