Use these tools rather than edit the webcache.xml configuration file, to perform all administrative tasks unless a specific procedure requires you to edit a file. Editing a file may cause the settings to be inconsistent and generate problems.

2.2 About Site Configuration

Oracle Web Cache caches and assembles dynamic content for one or more Web sites. When you configure the following properties for Oracle Web Cache, you apply them to all sites or to a particular site:

Sessions

Security

Request filtering

Caching rules

Access logging

You must create site definition for any named sites. A site definition consists of a host name, port information, and optional URL path prefix about the site and its aliases. Alias information is essential, because many sites are represented by one or more aliases. Oracle Web Cache recognizes and caches requests for a site and its aliases. For example, site www.company.com:80 may have an alias of company.com:80. By specifying this alias, Oracle Web Cache caches the same content from either company.com:80 or www.company.com:80.

When configuring a named site, you can enable compression for a site, permitting Oracle Web Cache to perform automatic compression for that site. You can also configure compression for undefined sites. Oracle Web Cache uses the compression setting for undefined sites for client requests that do not match a defined site. If you prefer to disable compression for all requests, see Section 2.11.3.1.

In addition to configuration for named sites and undefined sites, Oracle Web Cache provides configuration for a default site for client requests without host information. When you install Oracle Web Cache, the default site uses the host name and listening port of the computer on which Oracle HTTP Server was installed.

Because Oracle Web Cache resolves a request first to a site definition, and then to the first matching site-to-origin server mapping, the order in which you configure the site definitions is important.

For example, consider site definitions configured in this order:

www.company.com:80
www.company.com:80/sales

Because www.company.com:80 is a superset of www.company.com:80/sales, Oracle Web Cache matches requests for www.company.com:80/sales to site definition www.company.com:80 rather than www.company.com:80/sales. In addition, Oracle Web Cache uses the site-to-server mapping for www.company.com:80.

To avoid this problem, you would have to configure the site definitions in the following order:

www.company.com:80/sales
www.company.com:80

After you create site definitions, create ordered mappings of sites to origin servers. To avoid requests being mapped to the wrong site, you must be careful in how you order these mappings:

Because mappings that use the wildcard * encompass a broader scope, give these mappings a lower priority than other mappings.

Because requests are resolved to the first matching mapping, give mappings that contain the optional URL path prefix a higher priority than those mappings without an URL path prefix.

If you instead reorder the mappings as follows, the request for URLs http://www.company.com/portal/page?_pageid=33,4232&_dad=portal and http://www.company.com/um/traffic_cop?mailid=inbox do not resolve as expected. Requests for these URLs instead resolve to http://www.company.com because it is listed first:

To avoid swapping objects in and out of the cache, it is crucial to configure enough memory for the cache. Generally, the amount of memory (maximum cache size) for Oracle Web Cache should be set to at least 512 MB.

Your application's memory requirements vary based upon factors, such as object size, number of objects, the number of HTTP headers returned, and whether ESI is present. To get a close approximation on the maximum amount of memory required, you may apply the formula provided below.

Most customers leave this setting to the default which is 500 MB. If want to change the default, perform the following steps to determine the maximum amount of memory required:

Use the following formula to determine an estimate of the maximum memory, in bytes, needed

1.25*(TotalDocs * ((AvgDocSize/8192+1) *8192 + 16384))

In the formula:

.25 accounts for the run time memory overhead.

TotalDocs is the total number of objects you intend to store in the cache.

AvgDocSize is the average size of objects, in bytes, you intend to store in the cache. You can determine the average size by viewing the following metrics on the Performance Summary page.

Performance of each Site with Summary > site > Cache Size

Performance of each Site with Summary > site > Number of Cached

See Section 8.4 for further information about the Performance Summary page.

Note:

Even though you specify that certain objects should be cached, not all of the objects are cached at the same time. Only those objects that have been requested and are valid are stored in the cache. As a result, only a certain percentage of your objects are stored in the cache at any given time. That means that you may not need the maximum memory derived from the preceding formula.

Convert the result to megabytes.

Specify the estimated memory in the Oracle Web Cache configuration. See Section 2.11.5.

Use a simulated load or an actual load to monitor the cache to see how much memory it really uses in practice.

Remember that the cache is empty when Oracle Web Cache starts. For monitoring to be valid, ensure that the cache is fully populated. That is, ensure that the cache has received enough requests so that a representative number of objects are cached.

The Performance Summary page of Fusion Middleware Control provides information about the current memory use and the maximum memory use. To access this page:

Navigate to the Web Cache Home page in Fusion Middleware Control. See Section 2.6.2.

From the Web Cache menu, select Monitoring and then Performance Summary.

2.3.2 Maximum Incoming Connections

In addition to the cache size, it is important to specify a reasonable number for the maximum connection limit for the Oracle Web Cache server. The default is 500. If you set a number that is too high, performance can be affected, resulting in slower response time. If you set a number that is too low, Oracle Web Cache serves fewer fewer concurrent requests. You must strike a balance between response time and the number of requests processed concurrently.

To help determine a reasonable number, consider the following factors:

The maximum number of clients you intend to serve concurrently at any given time.

The average size of a page and the average number of requests for page.

Network bandwidth. The amount of data that can be transferred at any one time is limited by the network bandwidth.

The percentage of cache misses. If a large percentage of requests are cache misses, the requests are forwarded to the application Web server. Those requests consume additional network bandwidth and result in longer response times.

How quickly a page is processed. Use a network monitoring utility, such as ttcp or LoadRunner, to determine how quickly your system processes a page.

The cache cluster member capacity, if you have a cache cluster environment. The capacity reflects the number of incoming connections from other cache cluster members. See Section 3.6.3 to configure this setting in Fusion Middleware Control and Section 3.7.1 to configure this setting in Oracle Web Cache Manager.

Use various tools, such as those available with the operating system and with Oracle Web Cache, to help you determine the maximum number of connections. For example, thenetstat-a command on UNIX and Windows operating systems enables you to determine the number of established connections; the ttcp utility enables you to determine how fast a page is processed. The Web Cache Home page and the Performance Summary page in Fusion Middleware Control provide statistics on hits and misses. From Web Cache menu, select Home and Monitoring > Performance Summary to access these page.

Do not set the value to an arbitrarily high value, because Oracle Web Cache sets aside some resources for each connection, which could adversely affect performance. For many UNIX systems, 5000 is usually a reasonable number.

To specify the maximum number of incoming connections, see Section 2.11.5.

Connections on UNIX

On most UNIX platforms, each client connection requires a separate file descriptor. Oracle Web Cache tries to reserve the maximum number of file descriptors (Max_File_Desc) when it starts. If the Oracle Web Cache webcached executable is run as root, you can increase this number. For example, on Sun Solaris, you can increase the maximum number of file descriptors by setting the rlim_fd_max parameter. If the webcached executable is not run with the root privilege, Oracle Web Cache fails to start.

On most UNIX platforms, each client connection requires a separate file descriptor. The Oracle Web Cache server attempts to reserve the maximum number of file descriptors when it starts. If you have root privileges, you can increase this number. For example, for the LINUX Red Hat Operating System you can increase the maximum number of file descriptors by modifying Oracle Web Cache users file descriptors limits in /etc/security/limits.conf.

For example to allow the user WC_USER to have 4092 connections, in the /etc/security/limits.conf file add the following entries:

WC_User soft nofile 4092
WC_User hard nofile 4092

Make sure the parameter fs.file-max is set to 65k in the /etc/sysctl.conf. On Solaris Operating System you can increase the maximum number of file descriptors by setting the rlim_fd_max parameter. If webcached is not run as root, the Oracle Web Cache server logs an error message and fails to start.

For instructions on changing the webcached executable to run with the root privilege, see Section 5.9.

On Windows operating systems, the number of file handles as well as socket handles is limited only by available kernel resources, more precisely, by the size of paged and non-paged pools. However, the number of active TCP/IP connections is restricted by the number of TCP ports the system can open.

The default maximum number of TCP ports is set to 5000 by the operating system. Of those, 1024 are reserved by the kernel. You can modify the maximum number of ports by editing the Windows registry. Windows operating systems allow up to 65534 ports.

To change the default, you must add a new value to the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Add a new value, specifying the following:

Value Name: MaxUserPort

Value Type: DWORD

Value Data: 65534

Valid Range: 5000 to 65534

On Windows operating systems, Oracle Web Cache does not attempt to reserve file handles or to check that the number of current maximum incoming connections is less than the number of TCP ports.

2.3.3 Maximum Cached Object Size

To conserve system resources, you can limit the size of objects that are cached, even if the objects meet other caching rules.

If you specify a maximum cached object size, the cache only stores objects that are not larger than a specified size and that match the caching rules. Oracle Web Cache does not cache objects larger than the specified size, even if they match caching rules. The default is 100 KB. For upgraded caches, the default is that no limit is specified.

If you have objects that are larger than the maximum cached object size and those objects are requested frequently, consider increasing the limit. When you specify a value of 0, Oracle Web Cache does not cache any objects, effectively turning off caching.

2.3.4 Network Timeouts

Oracle Web Cache enables you to specify settings for the following timeouts:

Keep-Alive Timeout: The keep-alive timeout is the time limit for the client to process a request from Oracle Web Cache. After Oracle Web Cache sends a response to a client, the connection is left open for five seconds, which is typically enough time for the client to process the response from Oracle Web Cache. If the network between the client and Oracle Web Cache is slow, consider increasing the keep-alive timeout.

Client Send: Specifies the allowed time for Oracle Web Cache to finish a send operation to the client.

Client Receive: Specifies the allowed for Oracle Web Cache to wait for a receive operation to complete from the client.

Origin Server Send: Specifies the time allowed for the Oracle Web Cache to finish a send operation to the origin server.

Origin Server Receive: Specifies the time allowed for the origin server to generate and start sending a response to Oracle Web Cache.

Origin Server Connect: Specifies the time allowed for Oracle Web Cache to complete connection establishment to an origin server. If an origin server has multiple IP addresses (for example., IPv4 and IPv6) that will be retried, the timeout refers to connecting to one origin server IP address. If the origin server cannot generate a response within that time, Oracle Web Cache drops the connection and sends a network error page to the client. If applications require a shorter timeout, adjust the timeout.

2.5 About IP Addresses

138.1.16.102/255.255.0.0 specifies an IP address and subnet mask, 138.1.any.any. The zeros in the mask mean that any value is OK. This address is equivalent to 138.1.0.0/255.255.0.0 or 138.1.*.*.

138.1.16.102/16 is another way to specify the previous example. It means that only the high 16 bits matter.

You must use the wildcard for an entire field. Therefore, you cannot use a wildcard to specify something like 138.128.0.0/255.128.0.0. In this example, the high 9 bits need to be checked. 138.128*.*.* is not allowed. 138.*.*.* would check only the high 8 bits, and the other 3 8-bit fields could have any value.

The following examples show IP version 6 addresses:

FE80:0:0:0:205:2FF:FE71:2594 specifies an IP address.

FE80:0:0:0:205:0:0:0/FFFF:FFFF:FFFF:FFFF:FFFF:0:0:0 specifies an IP address and subnet mask. Here the high 16*5 = 80 bits, where 16*5 is 16 bits from each FFFF * 5 fields of FFFF, need to be checked for a match. If you prefer to use a wildcard, you can specify the same address as FE80:0:0:0:205:*:*:*.

FE80:0:0:0:205:0:0:0/80 is another way to specify the previous example. It also specifies to check the high 80 bits.

A farm is a collection of components managed by Fusion Middleware Control. It can contain Oracle WebLogic Server domains, one Administration Server, one or more Managed Servers, and the Oracle Fusion Middleware components that are installed, configured, and running in the domain.

You can also monitor performance statistics and perform operational tasks, such as starting and stopping a cache, synchronizing configuration among cache cluster members using Fusion Middleware Control.

2.6.1Logging into Fusion Middleware Control

To view the Oracle Web Cache pages:

To display Fusion Middleware Control, you enter the Fusion Middleware Control URL, which includes the name of the host and the port number assigned to Fusion Middleware Control during the installation. The following shows the format of the URL

http://hostname.domain:port/em

The port number is the number of the Administration Server of Oracle WebLogic Server. By default, the port number is 7001.

Enter the Oracle Fusion Middleware administrator user name and password and click Login.

The default user name for the administrator user is weblogic. The password is the one you supplied during the installation of Oracle Fusion Middleware.

2.6.2Navigating to Oracle Web Cache Administration Pages

To navigate to Oracle Web Cache administration tasks:

From the navigation pane, expand the farm and then the Web Tier installation type, and select Oracle Web Cache component.

This metric displays the status of the origin server when Oracle Web Cache last attempted to communicate with that origin server. (Oracle Web Cache attempts to reach the origin server only for specific purposes, such as retrieving responses for a cache miss.)

Up Time (%)

This metric is the up time is from the perspective of Oracle Web Cache. It is an approximation of the origin server's uptime. The accuracy is based on how long Web Cache has been up and how often Oracle Web Cache sends requests to that origin server.

Requests

This metric category provides the following metrics:

Total: This metric specifies the accumulated number of requests that the origin server has processed.

Errors: This metric specifies the number of errors encountered from this origin server by Oracle Web Cache. These errors may include:

- Oracle Web Cache failed to connect to the origin server.

- There was an error transmitting the request or receiving the response to or from the origin server

- There was an HTTP 500 class response from the origin server.

Average Response Time The metric specifies the average time the origin server has taken to process and reply to requests which it has received from this Oracle Web Cache.

Capacity

This metric category provides the following metrics:

Current Load: The metric specifies the current number of connections from Oracle Web Cache that the origin server has open.

Maximum Load: The metric specifies the maximum number of connections that the origin server has had open simultaneously.

Configured: The metric specifies the capacity set for the server in the Origin Servers page.

Note: If the value for the Maximum Load metric is close to the Configured metric, then increase the capacity in the Origin Servers page. See Section 2.11.2.

2.6.4 Using the Fusion Middleware Control Help

The Oracle Enterprise Manager Help command on the Help menu provides users with access to task-related or conceptual information relating to the current Fusion Middleware Control page. In addition, you can click a Help icon on some pages, where further explanation of page elements is necessary.

There is also a search feature, allowing you to search the help and selected Oracle Fusion Middleware documents that are included with the online help system. The help guides you to specific, context-sensitive information in these documents.

2.7.1 Starting Oracle Web Cache Manager

To start Oracle Web Cache Manager:

Configure a secure password for the Oracle Web Cache administrator with the monitor account. You use the password for the monitor account to log in to Oracle Web Cache Manager. See Section 5.2 to set a secure password.

Web Cache running with current configuration: This message appears if Oracle Web Cache is running with an up-to-date configuration.

Web Cache running in Routing Only mode with current configuration: This message appears if Oracle Web Cache is running with an up-to-date configuration.

Press "Apply Changes" to commit your modifications: This message appears if Submit has been selected in some dialog box, but the Apply Changes button has not been chosen.

Restart Web Cache to make configuration changes take effect: This message appears if Oracle Web Cache is running with an older version of the configuration. This can happen when static configuration changes have been applied to webcache.xml, but Oracle Web Cache was not restarted.

Dynamic Changes Applied. Restart Not Needed: This message appears if one or more dynamic configuration changes were applied, which do not require a restart of Oracle Web Cache.

Retrieve configuration from remote cache: This message appears if the cache has been recently upgraded to the current version of Oracle Web Cache but the configuration has not been copied to the local cache configuration file.

The navigator frame contains the following major categories described in Table 2-1. Additional categories and options are available, but Fusion Middleware Control provides the preferred functionality in these areas.

Table 2-6 Web Cache Manager Navigation Pane Options

Category

Description

Operations

This category contains the following options:

Cache Operations: This option displays the Cache Operations page for starting, stopping, or restarting the cache server process. See Section 2.7.3 for further information.

Basic Content Invalidation: and Advanced Content Invalidation: These options enable you to invalidate content in the cache. See Section 7.7.2.1 for further information.

On-Demand Log File Rollover: This option enables you to immediately roll over event and access logs. See Section 9.8 for further information.

Filtering

The preferred method for configuring request filters is using Fusion Middleware Control, as described in Chapter 4, "Configuring Request Filtering." Use the Request Filters option in Oracle Web Cache Manager to copy rules and revert configuration settings, as described in Section 4.14.

Properties

This category contains the following options:

Security: This option provides advanced security options. See Chapter 5 for further information.

Network Timeouts:This option enables you to configure the network setting for connections. See Section 2.11.5 for further information.

Logging and Diagnostics

This category contains the following option:

Diagnostics:This option enables diagnostics information to display in the HTML response body of an object. See Section 8.8 for further information.

2.7.3 Understanding the Cache Operations Page

The Cache Operations page of Oracle Web Cache Manager (Operations > Cache Operations) provides information about the status of a cache and what operations are needed. From this page, you can start, stop, or restart a cache.

If the cache is part of a cache cluster, all caches in the cluster are listed on the Cache Operations page. In addition to starting, stopping, and restarting a cache, you can propagate the configuration to other cluster members from this page. You can perform the operations on a selected cache or on all caches in the cluster. To minimize disruption in your Web site, you can specify an interval to stagger the times that the operations begin on the caches.

The admin server process transfers the contents of the webcache.xml configuration file between the Oracle Web Cache instance and the Oracle WebLogic Server environment where Fusion Middleware Control is running.

The cache server process manages the cache.

OPMN provides the opmnctl command. The command is located in the following directory:

(UNIX) ORACLE_INSTANCE/bin/
(Windows) ORACLE_INSTANCE\bin

To get started with OPMN, use the opmnctl command to query the status of the components in your installation and obtain a list of all the ports in use:

opmnctl status -l

Then, you use OPMN to control Oracle Web Cache. The following shows the format of the opmnctl commands:

opmnctl command [parameter=value] [parameter=value]

Table 2-7 shows the commands of the opmnctl utility that are applicable to Oracle Web Cache.

Table 2-7 Commands of the opmnctl Utility

Command

Description

startproc

Starts the specified process or component.

stopproc

Stops the specified process or component. If used to stop the cache server process, this command also clears the cache of all content and all statistics. It waits for all currently accepted requests to be served, or until the user-specified timeout, before stopping the cache.

To stop the specified process immediately, use the WCShutdown=abort parameter shown in Table 2-8.

restartproc

Stops, then restarts the specified process or component.

startall

Starts all processes controlled by OPMN.

stopall

Stops all processes controlled by OPMN.

status

Shows the status of the processes controlled by OPMN. For more information about the options for the status command, at the command line, enter:

opmnctl status -help

Table 2-8 shows the parameters for the opmnctl utility. It also shows the valid values that are applicable for Oracle Web Cache. Unless otherwise noted, you can use any parameter with any command, except for status, listed in Table 2-7.

Table 2-8 Parameters for the opmnctl Utility

Parameter

Valid Values

Description

ias-component=component_name

Oracle Web Cache instance name

Takes the specified action for the Oracle Web Cache admin server process and cache server process. For example, the following command starts both the Oracle Web Cache admin server and cache server processes on system component webache1:

opmnctl startproc ias-component=webcache1

You must always specify this parameter to administer any Oracle Web Cache process.

process-type=value

WebCache

WebCache-admin

Takes the specified action for the process specified in the value:

WebCache: The cache server process

WebCache-admin: The admin server process

The parameter ias-component=component_name must precede this parameter. For example, the following command starts only the cache server process for Oracle Web Cache webcache1:

opmnctl startproc ias-component=webcache1 process-type=WebCache

WCShutdown=value

abort

Used only with the stopproc command. Aborts (immediately stops) the specified process or component. Note the following differences between a normal shutdown and an abort shutdown:

During an normal shutdown, Oracle Web Cache does not accept any new connections, but it satisfies the request for connections that were made before receiving the stopproc command. After the requests are satisfied, the cache shuts down.

During an abort shutdown, Oracle Web Cache does not accept any new connections. In addition, it drops all existing connections, even if the requests have not been satisfied. Then, the cache shuts down.

The parameter ias-component=component_name must precede this parameter.

2.9 Basic Tasks for Configuring and Managing Oracle Web Cache

When you configure an environment with Oracle Web Cache, you first ensure the Oracle Web Cache component is added to the installation. If it is not, add the Oracle Web Cache component to the configuration.

The following provides a summary of the steps to configure and manage a basic Oracle Web Cache:

Add Oracle Web Cache system component to an environment. See Section 2.10.

2.10Adding an Oracle Web Cache System Component to an Environment

For an Oracle Web Tier or an Oracle Portal, Forms, Reports and Discoverer installation in which Oracle Web Cache was not selected, you can easily add an Oracle Web Cache system component, because the Oracle Universal Installer installs the necessary software.

2.11.1 Task 1: Configure Port Configuration for Oracle Web Cache

Oracle Web Cache uses a HTTP or HTTPS listening port to received requests. You can add listening ports, if necessary. For example, it may be necessary to add a listening port to assign Oracle Web Cache a port that an origin server was previously listening on.

In addition to a listening port, Oracle Web Cache also receives requests for the admin server process, invalidation, and statistics monitoring requests on specific HTTP or HTTPS listening ports. You can modify these operation ports.

This section contains the following topics related to port configuration for Oracle Web Cache:

2.11.1.3 Adding an Oracle Web Cache Listening Port

You can add listening ports, if necessary. For example, it may be necessary to add listening port to assign Oracle Web Cache a port that an origin server was previously listening on. If want to configure an HTTPS port, see Section 5.4.2.

To add an HTTP listening port:

Navigate to the Web Cache Home page in Fusion Middleware Control. See Section 2.6.2.

IP version 4 address written in a 32-bit dotted decimal notation or an IP version 6 address written in a 128-bit notation. See Section 2.5.

A host name that resolves to an IP address of the computer running Oracle Web Cache. If you do not want to rely on Domain Name System (DNS) to resolve the host name, use a different name resolution mechanism, such as the UNIX etc/hosts file.

ANY to represent any IP address

In the Port field, enter the listening port from which Oracle Web Cache receives client requests for the Web site.

Ensure that this port number is not already in use.

Port numbers less than 1024 are reserved for use by privileged processes on UNIX. To configure Oracle Web Cache to listen on a port less than 1024, such as on port 80, run the Oracle Web Cache webcached executable with the root privilege. If the webcached executable is not run as root, Oracle Web Cache fails to start.

See Section 5.9 for instructions on changing the webcached executable to run as root.

If you are changing the listening port from an HTTP port to an HTTPS port, see Section 5.4.2 to configure SSL settings.

IP version 4 address written in a 32-bit dotted decimal notation or an IP version 6 address written in a 128-bit notation. See Section 2.5.

A host name that resolves to an IP address of the computer running Oracle Web Cache. If you do not want to rely on Domain Name System (DNS) to resolve the host name, use a different name resolution mechanism, such as the UNIX etc/hosts file.

ANY to represent any IP address

In the Port field, enter the listening port from which Oracle Web Cache receives client requests for the Web site.

Ensure that this port number is not already in use.

Port numbers less than 1024 are reserved for use by privileged processes on UNIX. To configure Oracle Web Cache to listen on a port less than 1024, such as on port 80, run the Oracle Web Cache webcached executable with the root privilege. If the webcached executable is not run as root, Oracle Web Cache fails to start.

See Section 5.9 for instructions on changing the webcached executable to run as root.

If you are changing a port from an HTTP port to an HTTPS port, see Section 5.5.1 to configure SSL settings.

If Oracle HTTP Server was installed, the installation process creates a default origin server based on the host name and listening port of Oracle HTTP Server.

Oracle Web Cache only forwards requests to a configured origin server if the origin server is mapped to a Web site.

When you configure multiple origin servers, ensure the host and port settings are not identical. If you configure origin servers with duplicate host and port settings, both the cache server and admin server processes fail to start.

To configure Oracle Web Cache with origin server information:

Navigate to the Web Cache Home page in Fusion Middleware Control. See Section 2.6.2.

From the Web Cache menu, select Administration and then Origin Servers.

The Origin Servers page displays.

Click Create.

The Create Origin Server page displays.

Configure the Host, Port, Capacity, Protocol, and Routing Enabled settings for each origin server to send Oracle Web Cache requests using the descriptions in Table 2-9.

For configurations with multiple origin servers, specify how you want to HTTP distribute requests Oracle Web Cache sent to other origin servers when there is a failure in the Failover section using the descriptions in Table 2-9.

Specify these settings if these origin server is a proxy server in the Proxy Web Server section using the descriptions in Table 2-9.

Click OK to apply changes and return to the Origin Servers page. It is not necessary to click Apply in the Origin Servers page to apply this change.

Note: Oracle Web Cache must listen on the same port as the application Web server being proxied. When configuring proxy servers, ensure there is a corresponding listening port for every proxied port.

Capacity

Enter the maximum number of concurrent connections that the origin server can accept.

You determine this number by load testing the origin server until it runs out of CPU, responds slowly, or until a back-end database reaches full capacity.

In a cache cluster, Oracle Web Cache ensures that the total number of connections from all cluster members to the origin server does not exceed the capacity. Each cluster member is allowed a percentage of the maximum connections, using the following formula:

Select either HTTP to send HTTP requests on the port or HTTPS to send HTTPS requests on the port.

Routing Enabled

Click to permit Oracle Web Cache to route requests to the origin server or leave unchecked to only serve requests from cache.

Oracle recommends not selecting this option if temporary maintenance of an origin server is needed.

Oracle Web Cache tries to route a request matching a particular site to all origin servers mapped to that site. If all of the origin servers have Routing Enabled not selected, Oracle Web Cache serves a network error page to clients. See Section 2.11.6 for further information about configuring error pages.

Failover Threshold

Enter the number of allowed continuous read and write failures with an origin server on established connections.

When the threshold is met, Oracle Web Cache considers the origin server down and performs automatic failover of the origin servers. If an origin server fails at any time after Oracle Web Cache has started to send a request, then Oracle Web Cache increments the failure counter. The failure counter is reset if there is a successful server response. A request is considered failed if:

There are any network errors other than connection failure errors.

The HTTP response status code is something other than 1xx, 2xx, 3xx, 4xx, 501 Not Implemented, and 505 HTTP Version Not Supported.

After the threshold is met, Oracle Web Cache considers the server down and uses other servers for future requests. Oracle Web Cache starts polling the down server, by sending requests to the URL specified in the Ping URL field. When Oracle Web Cache receives a successful response from the server without any network errors and the HTTP response code is not less than 100, or not equal to 500, 502, 503, 504, Oracle Web Cache considers the server up again and uses it for future requests.

Notes:

The threshold does not apply if Oracle Web Cache cannot connect to an origin server. In this case, Oracle Web Cache immediately considers the server down and does not use it for future requests. If there are other origin servers, Oracle Web Cache retries the request to another origin server. If there no servers configured, Oracle Web Cache returns an error.

The failover to another origin server does not apply if there is only one origin server left.

Ping URL

Enter the URL that Oracle Web Cache uses to poll an origin server that has reached its failover threshold:

For an application Web Server, enter either a relative or a fully qualified URL that includes the domain name, or site name, representing the virtual host of the application Web server.

For a proxy server, enter a fully qualified URL that includes the domain name, or site name, representing the virtual host of the origin server behind the proxy server.

The default value is:

/

Rather than using a static URL, Oracle recommends using a URL that checks the health of the application logic on the origin server and returns the appropriate HTTP 200 or 500 status codes.

Ping Frequency (seconds)

Enter the time, in seconds, that Oracle Web Cache uses to poll an origin server that has reached its failover threshold.

The default is 10 seconds.

Proxy Web Server

Click to treat this origin server as a proxy server.

Username

Enter the user name for the proxy server administrator.

Password

Enter the password of the proxy server administrator

Confirm Password

Reenter the password for the proxy server administrator.

2.11.3 Task 3: Specify Site Definitions

For Oracle Web Cache to act as a virtual server for one or more Web sites, configure Oracle Web Cache with information about the named Web sites. For an overview of site configuration, see Section 2.2.

To create site definitions:

Navigate to the Web Cache Home page in Fusion Middleware Control. See Section 2.6.2.

From the Web Cache menu, select Administration and then Sites.

The Sites page displays.

From the Site Definitions section, click Create.

The Create Site page displays.

In the Create section, configure the elements using the descriptions in Table 2-10.

In the Aliases section, specify all the possible aliases for the site to ensure requests are directed to the correct site. An alias specifies the host and port in which browsers use to connect to the site.

Click Create to create an alias.

Configure the Host and Port fields using the descriptions in Table 2-10.

Click OK to apply changes and return to the Sites page. It is not necessary to click Apply in the Sites page to apply this change.

In the Sites page, use the Move Up and Move Down icons to order the definitions.

Oracle Web Cache resolves an incoming request first to a site definition, and then to the first matching site-to-origin server mapping. See Section 2.2 for more information about how Oracle Web Cache uses the order of site definitions and site-to-server mappings to match requests.

Click Apply to apply the move change.

Table 2-10 Create Site Page

Element

Description

Host

In the Create Site section, enter the site pattern, such as www.company.com. To enable Oracle Web Cache to match requests to this site, do not add protocol information (http:// or https://) to the host name.

In the Aliases section, enter the alias name for the site, such as company.com. To enable Oracle Web Cache to match requests to this alias, do not add protocol information (http:// or https://) to the host name.

Note: Do not use the wildcard * to represent multiple sites.

Port

Enter the HTTP or HTTPS port number from which Oracle Web Cache is listening for incoming requests.

URL Prefix

To distinguish sites that share the same host name, enter the path prefix of the URLs. Ensure the prefix starts with "/". Do not include the file name or embedded URL parameters in the prefix.

For example, the following URLs share the same site name, but belong to two entirely differently applications potentially hosted on entirely different computers:

http://www.company.com/portal/page?_pageid=33,4232&_dad=portal

http://www.company.com/um/traffic_cop?mailid=inbox

These URLs are from completely different applications hosted on the same or different origin server. While the first URL shows an mail user a front page after login, the second URL displays an inbox. If the site host name is defined as www.company.com, then you specify the prefixes as /portal and /um to distinguish the sites.

Default Site

Click this option to make this site the default site Oracle Web Cache uses to forward requests without host information.

Compression

Click to instruct Oracle Web Cache to serve cacheable and non-cacheable content compressed to browsers. Not selecting this option means you are instructing Oracle Web Cache to not serve compressed content for this site.

2.11.4 Task 4: Map Site Definitions to Origin Servers

After you specify site definitions, you create ordered mappings of sites to origin servers. For an overview of site configuration, see Section 2.2.

If Oracle HTTP Server was installed, the installation process creates a default site-to-server mapping based on the host name and listening port of Oracle HTTP Server.

If you configured multiple origin servers in Section 2.11.2 for load balancing, then create one site-to-server mapping that maps all the applicable origin servers to the site. In that site-to-server mapping, select all the origin servers that apply for the site. If you split the origin servers among multiple site-to-server mappings, load balancing for the site does not occur in the intended manner.

To map sites to origin servers:

Navigate to the Web Cache Home page in Fusion Middleware Control. See Section 2.6.2.

From the Web Cache menu, select Administration and then Sites.

The Sites page displays.

From the Site-to-Server Mapping section, click Create.

The Create Site-to-Server Mapping page displays.

Configure the Host Pattern, Port Pattern, and Prefix elements:

In the Host Pattern field, enter the site pattern, such as www.company.com. To enable Oracle Web Cache to match requests to this site, do not add protocol information (http:// or https://) to the host name.

You can use the wildcard * in the Host Pattern field in the following ways:

- Map multiple site names to one or more application Web server or proxy servers. For example, *.company.com can be used to match sites site1.company.com and site2.company.com.

- Route cache misses to sites outside a firewall and accessible by a proxy server. For example, * can be used to map to proxy server proxy-host.

In the Port Pattern field, enter the HTTP or HTTPS port number for the Web site from which Oracle Web Cache is listening for incoming requests.

You can use the wildcard * in the Port Pattern field to map the same site name with different port numbers to the same origin servers. If the origin servers are proxy servers, ensure they were configured to listen on the same port as the application Web server being proxied, as described in Section 2.11.2.

In the Origin Servers section, select the origin servers.

If you select multiple origin servers, the servers must be of the same type and use the same protocol on their listening port (HTTP or HTTPS). For example, you cannot have a mix of application Web servers and proxy servers.

Click OK to apply changes and return to the Sites page. It is not necessary to click Apply in the Sites page to apply this change.

In the Sites page, use the Move Up and Move Down features to order the mappings.

Oracle Web Cache resolves an incoming request first to a site definition, and then to the first matching site-to-origin server mapping. See Section 2.2 for more information about how Oracle Web Cache uses the order of site definitions and site-to-server mappings to match requests..

Select option Use for all caches in the cluster to apply the duration to all caches; deselect the option to apply the change to current cache only.

Click Submit.

Click Apply Changes.

You can always revert to the default values. In the Network Timeouts page, click Use Defaults, and then click Apply Changes to apply changes.

2.11.6 Task 6: Configure Error Pages

For situations in which there is a network communication error, site busy error, or ESI <esi:include> error, applications serve error pages. Rather than burden the origin server with this task, you can configure these pages to be served from Oracle Web Cache.

To configure Oracle Web Cache to serve error pages for a site:

Create error pages and place them in the following directory locations:

For network errors, the default setting is set to network_error.html. This error page is served when there is a network problem while connecting, sending, or receiving a response from an origin server for a cache-miss request.

For site busy errors, the default setting is set to busy_error.html. This page is served when origin server capacity is reached.

For ESI default fragments, the default setting is set to esi_fragment_error.txt. This page is served when Oracle Web Cache cannot fetch the src specified in an <esi:include> tag and the alt attribute, onerror attribute, or the try |attempt |except block are either not present or fail.

For a production environment, modify the defaults or create entirely new error pages to be consistent with other error pages for the site.

Select either Default Pages or a site name in the table, and then click Edit.

The Edit Error Pages dialog box appears.

In the Network Error Page field, enter the file name of the error page delivered for network communication problems between Oracle Web Cache and the Web site.

If you are using the default network_error.html page, leave the field as is.

In the Site Busy Page field, enter the file name of the error page delivered when a Web site is saturated with requests.

If you are using the default busy_error.html page, leave the field as is.

In the ESI Default Fragment field, enter the file name of the page delivered when Oracle Web Cache cannot retrieve an HTML fragment for an <esi:include> tag.

If you are not using <esi:include> tags for partial page caching or you want to use only ESI language elements for exceptions, do not enter a value.

Click Apply Changes.

If you selected Default Pages, Oracle Web Cache applies the new settings to all defined sites with the default page setting. However, Oracle Web Cache does not apply the new setting to undefined sites. If you selected a specific site in Step 3, Oracle Web Cache applies the new settings to the specific site.

In the Session Name field, enter an easy-to-remember unique name for the session.

Enter the cookie name in the Cookie Name field and the embedded URL parameter in the URL Post Body Parameters field.

If you enter both a cookie name and an embedded URL parameter, keep in mind that both must be used to support the same session. If they support different sessions, create separate session definitions.

Note:

When a cookie expires, the client browser removes the cookie and subsequent requests for the object are directed to the origin server. To avoid pages from being served past the client session expiration time, ensure that the session cookie expires before the application Web server expires the client session.

In the Default Value field, enter the default string for Oracle Web Cache to use for the cookie or embedded URL parameter value. Oracle Web Cache uses the default string for those requests without the cookie or parameter information. For these requests, Oracle Web Cache substitutes the session ID information with the default string. The default string defaults to default.

These commands start, stop, or restart both processes, if they have the same up or down status. If the two processes have different up and down statuses, then Fusion Middleware Control starts, stops, or restarts the appropriate process. For example, if the cache server process is running, but the admin server process is not and you choose Start Up, then only the admin server is started.

2.13.3 Starting and Stopping Using Oracle Web Cache Manager

Oracle Web Cache Manager enables you to start and stop the cache server process. You must use Fusion Middleware Control or opmnctl to start, stop, or restart the admin server process.