Skip Headers

Oracle9iAS Web Cache Administration and Deployment Guide
Release 2 (9.0.2)

Part Number A95404-02
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

F
Using Oracle9iAS Web Cache with Third-Party Application Web Servers

This chapter discusses how to configure Oracle9iAS Web Cache with third-party application Web servers.

This chapter contains these topics:

Overview of Third-Party Application Servers

Because Oracle9iAS Web Cache is transparent to the application Web server, the application Web server treats HTTP requests from Oracle9iAS Web Cache as any other HTTP request coming directly from the browser. In turn, the application Web server generates the response and sends it back to Oracle9iAS Web Cache as an HTTP message.

Because Oracle9iAS Web Cache fully supports HTTP, it can work with any HTTP-compliant application Web server. How the application Web servers choose to generate HTTP responses is irrelevant to Oracle9iAS Web Cache.

The type of application Web server that a site uses depends mainly on the types of applications that site is running. For example, if customers want to run Active Server Pages (ASP), then they may prefer to use Microsoft Internet Information Server (IIS) as the application Web server.

This section contains these topics:

Web-Site Configuration

You configure Oracle9iAS Web Cache to communicate with a third-party application Web servers the same way you would with Oracle HTTP Server, by providing the host name and the listening port number. The default values for the listening ports for the products discussed in this chapter are given in Table F-1.

Table F-1  Third-Party Application Web Server Default Listening Ports
Application Web Server Port

BEA WebLogic Server 6.0

7001

IBM WebSphere Application Server, Version 4.0

80

Microsoft IIS 5.0

80

To configure Oracle9iAS Web Cache to communicate with a third-party application Web server, perform the following tasks:

Caching Rules and Expiration Rules

You assign caching rules and expiration rules when using third-party application Web servers in the same way as when using Oracle HTTP Server. You can select to cache or not to cache content for the following:

You can also assign an expiration time limit to documents or invalidate documents at any time.

See Also:

Chapter 7, "Creating Caching Rules"

BEA WebLogic Server 6.0

The WebLogic Server 6.0 installation includes a number of Java Server Pages (JSP), Java servlets, and Enterprise JavaBeans (EJB) examples. For the purposes of this section, the following examples are used:

WebLogic SnoopServlet

The SnoopServlet servlet obtains and uses request information, headers, and parameters sent by the browser. Use it to demonstrate how Oracle9iAS Web Cache caches full-page dynamic content with SnoopServlet.

To start, perform the following:

  1. Ensure that Oracle9iAS Web Cache has been configured to communicate with the WebLogic Application Server, as described in "Web-Site Configuration".

  2. Start the WebLogic Server, and then access the following URL:

    http://hostname:7001/examplesWebApp/SnoopServlet
    
    

    When you access the URL, notice that your browser displays request information, headers, parameters, and the GIF image "Build On bea."

To cache the content:

  1. Create a caching rule for the SnoopServlet output, as described in "Configuring Caching Rules".

    When creating the caching rule for the SnoopServlet output, configure the following in the Edit Cacheability Rule dialog box:

    1. In the URL Expression field, enter /examplesWebApp/SnoopServlet.

    2. In the Method row, choose GET.

    3. Select Cache.

    4. Leave all other defaults in the Edit Cacheability Rule dialog box as is.

  2. Point the browser to the Oracle9iAS Web Cache with following URL:

    http://web_cache_hostname:7777/examplesWebApp/SnoopServlet
    
    

    The output is the same as it was when you accessed SnoopServlet directly from the WebLogic Server. This time, Oracle9iAS Web Cache caches the SnoopServlet output and serves the request to the browser.


    Note:

    Port 7777 is the default listening port for Oracle9iAS Web Cache. If you changed the default listening port, use that port number.


  3. View the contents of the cache, as described in "Listing the Contents of the Cache", to ensure that SnoopServlet is cached.

    From this point on, anytime a browser accesses SnoopServlet, the response will be served from Oracle9iAS Web Cache.

WebLogic SessionServlet

The SessionServlet servlet provides a simple example of an HTTP servlet that uses the HttpSession class to track the number of times that a browser has visited the servlet. Use it to demonstrate how Oracle9iAS Web Cache caches pages with session-encoded URLs.

To start, perform the following:

  1. Ensure that Oracle9iAS Web Cache has been configured to communicate with the WebLogic Server, as described in "Web-Site Configuration".

  2. Configure the browser not to accept cookies.

    This is required in order to use session-encoded URLs in this example. Finally, start the WebLogic Server and access the following URL:

    http://hostname:7001/examplesWebApp/SessionServlet
    
    

    Notice that the page displays how many times a browser has visited it. When you click the link labeled "here," notice that the session ID is encoded in the URL. Every time you refresh or reload the page, the counter increases by one.

To cache the content:

  1. Create an expiration rule, as described in "Configuring Expiration Rules".

    In the Create Expiration Rule dialog box, perform the following:

    1. In the Expire section of the Create Expiration Rule dialog box, select to expire the output 60 seconds after cache entry.

    2. In the After Expiration section of the Create Expiration Rule dialog box, select Remove immediately.

  2. Create a session-related caching rule, as described in "Configuring Session-Related or Personalized Attributed-Related Caching Rules".

    When configuring a session-related caching rule for SessionServlet, perform the following steps:

    1. In the Create Session/Personalized Attribute Definition dialog box:

      • In the Session/Attribute field, enter BEASession.

      • In the Cookie Name field, enter JSESSIONID.

        JSESSIONID is the default cookie name used by the WebLogic Server 6.0.

      • In the URL Parameter field, enter jsessionid.

    2. In the Add Session/Personalized Attribute Related Caching Rule dialog box:

      • From the Please select a session/attribute list, select BEASession.

      • Select YES for prompt 1.

      • Select YES for prompt 2.

      • Select NO for prompt 3.

    3. Create a new caching rule for SessionServlet, as described in "Configuring Caching Rules".

      When creating the caching rule for the SessionServlet output, configure the following in the Edit Cacheability Rule dialog box:

      • In the URL Expression field, enter /examplesWebApp/SessionServlet.

      • In the Method row, choose GET.

      • Select Cache.

      • In the Expiration Rule row, select Expire: 60 seconds in cache. After: remove immediately.

      • In the Session/Personalized Attribute Related Caching Rules row, select Apply the following and BEASession: cache with session, cache w/o session.

      • Leave all other defaults in the Edit Cacheability Rule dialog box as is.

  3. Point the browser to Oracle9iAS Web Cache with the following URL:

    http://web_cache_hostname:7777/examplesWebApp/SessionServlet
    
    

    The output is the same as it was when you accessed SessionServlet directly from the WebLogic Server. This time Oracle9iAS Web Cache caches the SessionServlet output. When the page is refreshed or reloaded, notice that the counter does not increment by one. This is because Oracle9iAS Web Cache serves the content, and the request never goes to the WebLogic Server.


    Note:

    Port 7777 is the default listening port for Oracle9iAS Web Cache. If you changed the default listening port, use that port number.


  4. View the contents of the cache, as described in "Listing the Contents of the Cache", to ensure that SessionServlet is cached.

    When you reload the page, notice that the cached response appears faster than when you access the WebLogic server directly.

    Because the expiration rule for this URL is set to 60 seconds, Oracle9iAS Web Cache expires the cached content after 60 seconds and reflects the content the next time the user requests the page.

IBM WebSphere Application Server, Version 4.0

The WebSphere Application Server, Version 4.0 installation includes a number of JSP, Java servlets, and EJB examples. For the purposes of this section, the following examples are used:

WebSphere Snoop Servlet

The snoop servlet shows getting and using request information, headers, and parameters sent by the browser. Use it to demonstrate how Oracle9iAS Web Cache caches full-page dynamic content.

To start, perform the following:

  1. Ensure that Oracle9iAS Web Cache has been configured to communicate with the WebSphere Application Server, as described in "Web-Site Configuration".

  2. Start the WebSphere Application Server, and then access the following URL:

    http://hostname/servlet/snoop
    
    

    Notice that request information, headers, and parameters sent by your browser are displayed.

To cache this content:

  1. Create a caching rule for the snoop output, as described in "Configuring Caching Rules".

    When creating the caching rule for the snoop output, configure the following in the Edit Cacheability Rule dialog box:

    1. In the URL Expression field, enter /servlet/snoop.

    2. In the Method row, choose GET.

    3. Select Cache.

    4. Leave all other defaults in the Edit Cacheability Rule dialog box as is.

  2. Point the browser to the Oracle9iAS Web Cache with following URL:

    http://web_cache_hostname:7777/servlet/snoop
    
    

    The output is the same as it was when you accessed snoop directly from the WebSphere Application Server. This time, Oracle9iAS Web Cache caches the snoop output and serves the response to the browser.


    Note:

    Port 7777 is the default listening port for Oracle9iAS Web Cache. If you changed the default listening port, use that port number.


  3. View the contents of the cache, as described in "Listing the Contents of the Cache", to ensure that snoop is cached.

    When you reload the page, you should notice that the cached response appears faster than when you access the WebSphere Application Server directly.

WebSphere SessionSample

The SessionSample servlet is a simple example of an HTTP servlet that tracks the number of times that a browser has visited the servlet using a cookie. Use it to demonstrate how Oracle9iAS Web Cache caches pages with session cookies.

This example is not a pre-deployed WebSphere example like the snoop servlet. You can find this example in Section 4.4.1.1: Session programming model and environment in the WebSphere Application Server online documentation, when you click the SessionSample.java link on that page.

To start, perform the following:

  1. Compile the SessionSample.java file in the WebSphere environment.

  2. Copy the SessionSample.class file in the location where the snoop.class file resides.

    The default location for the snoop.class file is WebSphere's install directory:

    \WebSphere\AppServer\hosts\default_host\default_app\servlets\
    
    
  3. Start the WebSphere Application Server, set the browser to accept cookies, and then access the following URL:

    http://hostname/servlet/SessionSample
    
    

    Notice that the page displays the number of times a browser has visited this page. When you reload this page, the counter increments by one.

To cache this content:

  1. Create an expiration rule, as described in "Configuring Expiration Rules".

    In the Create Expiration Rule dialog box, perform the following:

    1. In the Expire section of the Create Expiration Rule dialog box, select to expire the output 60 seconds after cache entry.

    2. In the After Expiration section of the Create Expiration Rule dialog box, select Remove immediately.

  2. Create a session-related caching rule, as described in "Configuring Session-Related or Personalized Attributed-Related Caching Rules".

    When configuring a session-related caching rule, perform the following steps:

    1. In the Create Session/Personalized Attribute Definition dialog box:

      • In the Session/Attribute field, enter IBMSession.

      • In the Cookie Name field, enter sessionid.

        sessionid is the default cookie name used by the WebSphere Application Server, Version 4.0.

      • In the URL Parameter field, enter sessionid.

    2. In the Add Session/Personalized Attribute Related Caching Rule dialog box:

      • From the Please select a session/attribute list, select IBMSession.

      • Select YES for prompt 1.

      • Select YES for prompt 2.

      • Select NO for prompt 3.

    3. Create a new caching rule for SessionSample, as described in "Configuring Caching Rules".

      When creating the caching rule for the SessionSample output, configure the following in the Edit Cacheability Rule dialog box:

      • In the URL Expression field, enter /servlet/SessionSample.

      • In the Method row, choose GET.

      • Select Cache.

      • In the Expiration Rule row, select Expire: 60 seconds in cache. After: remove immediately.

      • In the Session/Personalized Attribute Related Caching Rules row, select Apply the following and IBMSession: cache with session, cache w/o session.

      • Leave all other defaults in the Edit Cacheability Rule dialog box as is.

  3. Point the browser to Oracle9iAS Web Cache with the following URL:

    http://web_cache_hostname:7777/servlet/SessionSample
    
    

    The output is the same as when you access SessionSample directly from WebSphere Application Server. This time, Oracle9iAS Web Cache caches the SessionSample output. To verify that the content is served by the cache, refresh or reload the page. Notice that the counter remains the same. This is because Oracle9iAS Web Cache serves the content, and the request never goes to WebSphere Application Server.


    Note:

    Port 7777 is the default listening port for Oracle9iAS Web Cache. If you changed the default listening port, use that port number.


  4. View the contents of the cache, as described in "Listing the Contents of the Cache", to ensure that SessionSample is cached.

    When you reload the page, notice that the cached response appears faster than when you access the WebSphere server directly.

    Because the expiration rule for this URL is set to 60 seconds, Oracle9iAS Web Cache expires the cached content after 60 seconds and reflects the content the next time the user requests the page.

Microsoft IIS 5.0

The IIS 5.0 installation includes a number of ASP examples. For the purposes of this section, the following examples are used:

ServerVariables_Jscript ASP

ServerVariables_JScript.asp demonstrates techniques you can use to access server variable information from an ASP script. Use it to demonstrate how Oracle9iAS Web Cache caches full-page dynamic content.

To start, perform the following:

  1. Ensure that Oracle9iAS Web Cache has been configured to communicate with IIS, as described "Web-Site Configuration".

  2. Start IIS, and then access the following URL:

    http://hostname/IISSamples/sdk/asp/interaction/ServerVariables_JScript.asp
    
    
    

    Notice that request information, headers, and parameters sent by the browser are displayed.

To cache this content:

  1. Create a caching rule for the ServerVariables_JScript.asp, as described in "Configuring Caching Rules".

    1. In the URL Expression field, enter /IISSamples/sdk/asp/interaction/ServerVariables_JScript.asp.

    2. In the Method row, choose GET.

    3. Select Cache.

    4. Leave all other defaults in the Edit Cacheability Rule dialog box as is.

  2. Point the browser to the Oracle9iAS Web Cache with following URL:

    http://web_cache_
    hostname:7777/IISSamples/sdk/asp/interaction/ServerVariables_JScript.asp
    
    

    The output is the same as it was when you accessed ServerVariables_JScript.asp directly from IIS. This time, Oracle9iAS Web Cache caches the ServerVariables_JScript.asp output and serves the request to the browser.


    Note:

    Port 7777 is the default listening port for Oracle9iAS Web Cache. If you changed the default listening port, use that port number.


  3. View the contents of the cache, as described in "Listing the Contents of the Cache", to ensure that ServerVariables_JScript.asp is cached.

    When you reload the page, you should notice that the cached response appears faster than when you access IIS directly.

Cookie_Jscript ASP

Cookie_JScript.asp illustrates how your script can set and read cookies by using the Response.Cookies collection. Use it to demonstrate how Oracle9iAS Web Cache caches pages with session cookies.

To start, perform the following:

  1. Ensure that Oracle9iAS Web Cache has been configured to communicate with IIS, as described in "Web-Site Configuration".

  2. Start IIS, verify that your browser is set to accept cookies, and then access the following URL:

    http://hostname/IISSamples/sdk/asp/interaction/Cookie_JScript.asp
    
    

    When you access the URL, notice that the page displays the date and time you last visited this page. When you click "Revisit this page," the date and time is updated.

To cache this content:

  1. Create an expiration rule, as described in "Configuring Expiration Rules".

    In the Create Expiration Rule dialog box, perform the following:

    1. In the Expire section of the Create Expiration Rule dialog box, select to expire the output 60 seconds after cache entry.

    2. In the After Expiration section of the Create Expiration Rule dialog box, select Remove immediately.

  2. Create a session-related caching rule for Cookie_Jscript.asp, as described in "Configuring Session-Related or Personalized Attributed-Related Caching Rules".

    When configuring a session-related caching rule, perform the following steps:

    1. In the Session/Attribute field, enter MSSession.

    2. In the Cookie Name field, enter CookieJSCript.

    3. In the Add Session/Personalized Attribute Related Caching Rule dialog box:

      • From the Please select a session/attribute list, select MSSession.

      • Select YES for prompt 1.

      • Select YES for prompt 2.

      • Select NO for prompt 3.

    4. Create a new caching rule for Cookie_JScript.asp, as described in "Configuring Caching Rules".

    5. When creating the caching rule for the Cookie_JScript.asp output, configure the following in the Edit Cacheability Rule dialog box:

      • In the URL Expression field, enter /IISSamples/sdk/asp/interaction/Cookie_JScript.asp.

      • In the Method row, choose GET.

      • Select Cache.

      • In the Expiration Rule row, select Expire: 60 seconds in cache. After: remove immediately.

      • In the Session/Personalized Attribute Related Caching Rules row, select Apply the following and MSSSession: cache with session, cache w/o session.

      • Leave all other defaults in the Edit Cacheability Rule dialog box as is.

  3. Point the browser to Oracle9iAS Web Cache with the following URL:

    http://web_cache_hostname:7777/IISSamples/sdk/asp/interaction/Cookie_
    JScript.asp
    
    
    

    The output is the same as it was when you accessed Cookie_JScript.asp directly from IIS. This time, Oracle9iAS Web Cache caches the Cookie_JScript.asp output. To verify that the cache serves the content, click "Revisit this page." Notice that the date and time are not updated. This is because Oracle9iAS Web Cache serves the cached content, and the request never goes to IIS.


    Note:

    Port 7777 is the default listening port for Oracle9iAS Web Cache. If you changed the default listening port, use that port number.


  4. View the contents of the cache, as described in "Listing the Contents of the Cache", to ensure that Cookie_JScript.asp is cached.

    When you reload the page, notice that the cached response appears faster than when you access IIS server directly.

    Because the expiration rule for this URL is set to 60 seconds, Oracle9iAS Web Cache expires the cached content after 60 seconds and reflects the content the next time the user requests the page.


Go to previous page Go to next page
Oracle
Copyright © 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index