Most Web applications are typically based on the presentation of information, meaning that functional operations pertaining to retrieving, assembling, and presenting information in the form of content and data largely outnumber functional operations that actually modify the information.
For example, browsing detailed product information in an online store occurs exponentially more often than updating the product information. Caching offers critical benefits to the application that include, but are not limited to:
- Faster response times and increased application responsiveness: Requests are serviced faster, as pre-cached information is served up without having to query the data store and apply complex business rules and calculations to the result set.
- Increased throughput: Applications designed to take advantage of caching have much higher throughput rates because it is not necessary to retrieve data and perform complex calculations on the data for every request running on the same physical hardware infrastructure.
- High availability: If back-end components go offline temporarily, previously cached information can still be served up to the client.
- Scalability: Caching in the presentation and business tiers of the J2EE architecture greatly helps to reduce the consumption of system resources, allowing the applications to be scaled horizontally more easily when the need to support a higher client load arises. The application itself will need to be well designed to ensure horizontal scalability.
Caching and Web Application Architecture
Figure 1 depicts a widely used robust Web architecture. There are several opportunities in this architecture where information can be cached efficiently and served up.
Following is a brief description of the various points at which caching can be accomplished:
- WebSphere Edge Server in a reverse proxy configuration: WebSphere Edge Server is the initial point of contact for every request within an organization's DMZ. The Edge Server Web Traffic Express (WTE) component caches responses of dynamic content like JSP pages and servlets. An Edge Server adapter module is installed in WebSphere Application Server (WAS), which results in all dynamic content responses being modified by the adapter before returning to the Web server. The WebSphere Edge Server and WAS work together in invalidating caches to keep stale information from being served up in the cache.
- Web server caching: Most Web servers allow static files being served to be cached. Caching dynamic content can be done either by the Web server itself or by the WAS Web Server plug-in component. Both of these scenarios are typically limited in terms of cache invalidations and can be used as simple caching mechanisms with time-based invalidations.
- Presentation and business tier caching: These two logical tiers can be physically located in the same virtual machine, different virtual machines, or even on different nodes. Caching here offers the most flexibility of control over the cache in terms of security, configuration, and maintenance of the cache at run time.
上一页 下一页






