Oracle Web Cache Administration and Deployment Guide Release 1.0.2.3 Part Number A86722-03 |
Library | Service | Contents | Index

# 1
Introduction to Oracle Web Cache

This chapter describes the performance barriers faced by Web sites and introduces the technology which can provide a complete caching solution.

This chapter contains these topics:

- What is the Big Picture for Caching?

- Oracle's Solution to Web Site Performance Issues

- How Web Caching Works

- Benefits of Web Caching

- Features of Oracle Web Cache

## What is the Big Picture for Caching?

The e-business model creates new performance requirements for Web sites. To carry out electronic business successfully, Web sites must protect against poor response time and system outages caused by peak loads. Slow performance translates into lost revenue.

Many high-volume Web sites try to counter this problem by adding more application Web servers to their existing architecture. As more users access these Web sites, more and more application Web servers will have to be added. In short, the manageability costs associated with adding application Web servers often outweigh the benefits.

Static caches and content distribution services can provide some relief. However, these solutions are unable to serve content that is dynamically generated.

## Oracle's Solution to Web Site Performance Issues

Faced with these performance challenges, e-businesses need to invest in more cost-effective technologies and services to improve the performance of their sites. Oracle offers Oracle Web Cache to help e-businesses manage Web site performance issues. Oracle Web Cache is a content-aware server accelerator, or reverse proxy server, that improves the performance, scalability, and availability of Web sites that run on Oracle9i Application Server and Oracle8i.

By storing frequently accessed URLs in virtual memory, Oracle Web Cache eliminates the need to repeatedly process requests for those URLs on the application Web server. Unlike legacy proxy servers that handle only static documents, Oracle Web Cache caches both static and dynamically generated content from one or more application Web servers. Oracle Web Cache retrieves content faster than legacy proxies and greatly reduces the load on application Web servers.

Figure 1-1 shows the basic architecture. Oracle Web Cache sits in front of application Web servers, caching their content, and providing that content to Web browsers that request it. When Web browsers access the Web site, they send HTTP requests to Oracle Web Cache. Oracle Web Cache, in turn, acts as a virtual server to the application Web servers. If the requested content has changed, Oracle Web Cache retrieves the new content from the application Web servers. The application Web servers may retrieve their content from an Oracle database.

#### Figure 1-1 Oracle Web Cache Architecture

Text description of the illustration introa.gif

## How Web Caching Works

To Web browsers, Oracle Web Cache acts as the virtual server for application Web servers. You configure Oracle Web Cache with the same IP address that is registered for a site's domain name and the application Web servers' host names. This configuration enables Web browsers to communicate with Oracle Web Cache rather than application Web servers when accessing a Web site.

Figure 1-2 shows how Web caching works. Oracle Web Cache has an IP address of `144.25.190.240` and the application Web server has an IP address of `144.25.190.245`. The steps for browser interaction with Oracle Web Cache follow:

1. A browser sends a request to a Web site named `www.company.com`.

   This request in turn generates a request to Domain Name System (DNS) for the IP address of for the Web site.

2. DNS returns the IP address of Oracle Web Cache, that is, `144.25.190.240`.

3. The browser sends the request for the Web page to Oracle Web Cache, `144.25.190.240`.

4. If the requested content is in its cache, Oracle Web Cache sends the content directly to the browser. This is called a cache hit.

   Note: Dynamic content is generated by the application Web server and then returned to Oracle Web Cache before being passed to the browser.

5. If Oracle Web Cache does not have the requested content or the content is stale or invalid, it hands the request off to the application Web server. This is called a cache miss.

6. The application Web server sends the content through Oracle Web Cache.

7. Oracle Web Cache sends the content to the client and makes a copy of the page in cache.

   Note: A page stored in the cache is removed when it becomes invalid or outdated, as described in "Cache Freshness and Performance Assurance".

#### Figure 1-2 Web Server Acceleration

Text description of the illustration intro4.gif

## Benefits of Web Caching

Web caching provides the following benefits for Web sites:

- Performance

  Running on inexpensive hardware, Oracle Web Cache can increase the throughput of a Web site by several orders of magnitude. In addition, Oracle Web Cache significantly reduces response time to browser requests by storing documents in memory and by serving compressed versions of documents to browsers that support the GZIP encoding method.

- Scalability

  In addition to unparalleled throughput, Oracle Web Cache can sustain thousands of concurrent browser connections, meaning that visitors to a site see fewer application Web server errors, even during periods of peak load.

- High Availability

  Oracle Web Cache supports content-aware (Layer 4 - Layer 7) load balancing and failover detection. These features ensure that cache misses are directed to the most available, highest-performing Web server in the cluster. Moreover, a patent-pending capacity heuristic guarantees performance and provides surge protection when application Web server load increases.

- Cost Savings

  Better performance, scalability and availability translates into cost savings for Web site operators. Because fewer application Web servers are required to meet the challenges posed by traffic spikes and denial of service attacks, Oracle Web Cache offers a simple and inexpensive means of reducing a Web site's cost per request.

- Network Traffic Reduction

  Most requests are resolved by Oracle Web Cache, reducing traffic to the application Web servers. The cache also reduces traffic to backend databases located on computers other than the application Web server.

## Features of Oracle Web Cache

The main features of Oracle Web Cache make it a perfect caching service for e-business Web sites that host online catalogs, news services, and portals. These features include:

- Static and Dynamically Generated Content Caching

- Cache Invalidation

- Performance Assurance

- Surge Protection of Application Web Servers

- Load Balancing of Application Web Servers

- Security Features

- Administration

- Compression

### Static and Dynamically Generated Content Caching

Oracle Web Cache uses cacheability rules to store documents. These rules fall into two categories:

- Rules for static content, such as GIF, JPEG, or static HTML files

- Rules for dynamically generated content created using technologies like Java Server Pages (JSP), Active Server Pages (ASP), PL/SQL Server Pages (PSP), Java Servlets, and Common Gateway Interface (CGI). Support of these technologies enables Oracle Web Cache to recognize rules for the following:

  - Multiple-version documents for the same URL, that is, the same URL with slightly different content

  - Session-aware rules for pages containing session information

  - Personalization rules for pages containing personalized greetings, such as "Welcome <Name>", and session-encoded URLs

    See Also: "Caching Dynamically Generated Content" for further information about dynamically-generated content

### Cache Invalidation

Oracle Web Cache supports invalidation as a mechanism to keep its cache consistent with the content on the application Web servers, origin databases, or other dynamically generated means.

Administrators can invalidate cache content in one of two ways:

- Send an HTTP invalidation message to the computer running Oracle Web Cache

  When documents are invalidated and a browser requests them, Oracle Web Cache refreshes them with new content from the application Web server.

- Assign an expiration time limit to the documents

  When a document expires, Oracle Web Cache treats it like an invalid document, that is, if requested by a browser, it refreshes it with a updated content from the application Web server.

  See Also: "Cache Freshness and Performance Assurance" for further information about invalidation

### Performance Assurance

When a large number of documents have been invalidated, the retrieval of a new documents can result in overburdened application Web servers.

To handle performance issues while maintaining cache consistency, Oracle Web Cache uses built-in performance assurance heuristics that enable it to assign a queue order to documents. These heuristics determine which documents can be served stale and which documents must be refreshed immediately. Documents with a higher priority are refreshed first. Documents with a lower priority are refreshed at a later time.

The queue order of documents is based on the popularity of documents and the validity of documents assigned during invalidation. If the current load and capacity of the application Web server is not exceeded, the most popular and least valid documents are refreshed first.

See Also: "Cache Freshness and Performance Assurance" for further information about performance assurance

### Surge Protection of Application Web Servers

Oracle Web Cache passes requests for non-cacheable or stale documents to the application Web servers. To prevent an overload of requests on the application Web servers, Oracle Web Cache has a surge protection feature that enables you to set a limit on the number of concurrent requests that the application Web servers can handle. When the limit is reached, subsequent requests are queued to wait up to a maximum amount of time. If the maximum wait time is exceeded, Oracle Web Cache rejects the request and serves a site busy apology page to the Web browser that initiated the request.

### Load Balancing of Application Web Servers

Most Web sites are served by multiple application Web servers running on multiple computers that share the load of HTTP requests. This feature enables Web sites to be built with a collection of servers for better scalability and reliability. Oracle Web Cache is designed to manage HTTP requests for up to 100 application Web servers. All requests that Oracle Web Cache cannot serve are passed to the application Web servers. Oracle Web Cache has a load balancing feature that distributes these requests over a set of application Web servers. To configure load balancing, you set the capacity (concurrent connections) for each application Web server. Based on the capacity assigned, Oracle Web Cache prescribes the relative percentage load of each application Web server.

Figure 1-3 shows three application Web servers, whereby 30 percent of traffic goes to `www.server1.com`, 30 percent goes to `www.server2.com`, and 40 percent goes to `www.server3.com`.

#### Figure 1-3 Load Balancing

Text description of the illustration intro5.gif

#### Backend Failover

After five continuous request failures, Oracle Web Cache considers an application Web server as failed. When an application Web server fails, Oracle Web Cache automatically distributes the load over the remaining application Web servers based on the remaining proportion. Oracle Web Cache polls the failed application Web server for its current up/down status every 60 seconds until it is back online.

The failover feature is shown in Figure 1-4. An outage of`www.server3.com`, which was receiving 40 percents of requests, results in 50 percent of the requests going to `www.server1.com` and 50 percent of requests going to `www.server2.com`. This is based on a 30 percent load for both `www.server1.com` and `www.server2.com`. If `www.server1.com` were to fail instead, based on a 30 percent load for `www.server2.com` and a 40 percent load for `www.server3.com`, 42.86 percent of the requests would go to `www.server2.com` and 57.14 percent of requests would go to `www.server3.com.`

When the failed server returns to operation, Oracle Web Cache will include it in the load mix as previously prescribed.

#### Figure 1-4 Failover

Text description of the illustration intro3.gif

#### Application Web Server Binding

Oracle Web Cache supports Web sites that use session IDs and/or session cookies to bind user sessions to a given application Web server in order to maintain state for a period of time. To utilize the session binding feature, the application Web server itself must maintain state, that is, it must be stateful. Web sites bind user sessions by including session data in the HTTP header or body it sends to Web browsers in such a way that the browser is forced to include it with its next request. This data is transferred either with parameters embedded in the URL or cookies, which are text strings stored on the client.

Figure 1-5 shows how Oracle Web Cache supports documents that use application Web server binding:

1. When a request first comes in, Oracle Web Cache uses load balancing to decide which application Web server to send it to. In this example, `www.server2.com` was chosen.

2. If the requested document requires application Web server binding, the application Web server sends the session information back to the browser through Oracle Web Cache in the form of a cookie or an embedded URL parameter.

3. Oracle Web Cache sends subsequent requests for the session to the application Web server that established the session, bypassing load balancing. In this example, `www.server2.com` handles the subsequent requests.

#### Figure 1-5 Application Web Server Binding

Text description of the illustration intro2.gif

### Security Features

Oracle Web Cache provides important security features including:

- Password authentication for administration and invalidation operations

- Control over which ports administration and invalidation operations can be requested from

- Timeout for inactive connections

- IP and subnet administration restrictions

### Administration

Oracle Web Cache provides a graphical user interface tool called Oracle Web Cache Manager that combines configuration and monitoring options to provide an integrated environment for configuring and managing Oracle Web Cache and the Web sites it caches for. With the Oracle Web Cache Manager, you can easily:

- Configure Oracle Web Cache to cache for application Web servers

- Start and stop Oracle Web Cache

- Establish cacheability rules

- Monitor Oracle Web Cache and Web site performance

- Establish listening ports and security passwords

### Compression

You can select to have documents compressed upon insertion into the cache. Oracle Web Cache is able to compress 300 KB files down to 3 KB, increasing the overall throughput by a factor of 100.

| Copyright © 1996-2001 Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index