Caching static files for a Web application into the dynamic cache
 Technote (FAQ)
 
Problem
Users of WebSphere® Application Server for z/OS® Version 4.01 want to be able to cache static files for a Web application into the dynamic cache.
 
 
Solution
Use a copy of the WebSphere Application Server for distributed platforms V4.0 or higher AAT for Distributed Platforms to enable caching of static content for a Web application into the dynamic cache. Then use the WebSphere Application Server V4.0.1 for z/OS AAT tool to generate the deployment code for this Web application.

To enable caching of static content:

1. Define an instance of SimpleFileServlet as a Web component:
  1. Open the EAR file, and expand Web Modules.
  2. Click on a Web module which has static files.
  3. Under the IBM® Extensions tab, select File Serving Enabled if it is not already checked.
  4. Expand the entries under Web Module.
  5. Under Web Components, define an instance of the file serving servlet:
    1. Right click on Web Components and select New.
    2. Under the General tab, specify the following information:
      Component Name: file
      Component Description: File Serving Servlet
      Component Type: Servlet
      Class: com.ibm.servlet.engine.webapp.SimpleFileServlet
2. Click OK when done.

3. Define a servlet mapping for file:
  1. Right click on Servlet Mapping, and select New.
  2. Specify the following information:
    URL: /
    Servlet: file
4. Click OK when done.

5. Define a caching policy for the SimpleFileServlet instance:
  1. Expand the entries under Assembly Property Extensions.
  2. Right click on Servlet Caching Configuration, select New.
  3. Define a caching group, for example, "staticfiles."
  4. Specify a priority.
  5. Specify a timeout value (for example, 300 for 300 seconds).
  6. Click Add for Servlets and JSPs.
  7. Click file, for the file serving servlet.
  8. Under the ID Generation tab, select Use URIs for Cache ID building.
  9. Optionally, you can use the Advanced tab to specify caching to an External Cache.
6. Click OK when done. 7. Define caching policies for other servlets/JSPs as desired:
  1. Expand the entries under Assembly Property Extensions.
  2. Right click on Servlet Caching Configuration, select New.
  3. Define a new caching group, for example, "servlets."
  4. Specify a priority.
  5. Specify a timeout value (0 for no timeout).
  6. Click Add for Servlets and Java™ Server Pages (JSP).
  7. Select the servlet or JSP you want to cache.
  8. Under the ID Generation tab, specify the items to be used in cache-ids. For more information, see WebSphere Application Server Version V4.0.1 for z/OS and OS/390 Assembling J2EE Applications. This publication is available at URL: http://www.ibm.com/software/webservers/appserv/zos_os390/library/
  9. Optionally, you can use the Advanced tab to specify caching to an External Cache.

8. Click OK when done.

9. Repeat these steps for any other servlets or JSPs that you want to be cached. 10. Save the archive file and generate the deployment code.
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server for z/OS > Application Client
Operating system(s): z/OS
Software version: 4.0.1
Software edition:
Reference #: 1137193
IBM Group: Software Group
Modified date: May 29, 2004