Skip to main content

Web Application Architecture

InterSystems IRIS web applications are supported by three software components: a web server, the Web Gateway, and a CSP server, which runs on an InterSystems IRIS server:

CSP Components
Shows Web Gateway between the CSP Server and Web Server, and two-way communication between CSP Server and Web Gateway.

The web server and the CSP server may be implemented by one or many computers. During development, all three components (web server, Web Gateway, and CSP server) may be on a single machine. In a large scale deployment, there may be multiple web servers and CSP servers in two- or three-tier configurations.

What Each Component Does

The web server is a software utility that does the following:

  • Accepts incoming HTTP requests, usually from browsers

  • Checks permissions

  • Possibly serves static content

  • Sends requests for CSP content, URLs ending in .csp or .cls, to the Web Gateway

The Web Gateway is a shared library, a .dll file, or a CGI script that does the following:

  • Determines which InterSystems IRIS server to send a request to

  • Sends requests to the correct InterSystems IRIS server

  • Maintains connections to the InterSystems IRIS server (to avoid having to continually open new connections)

The CSP server is a process running on an InterSystems IRIS server that is dedicated to serving requests from the Web Gateway. It does the following:

  • Receives an HTTP request for an application

  • Checks the Application Configuration Settings, which are set in the Management Portal and saved in the .cpf file

  • Runs the associated class, either written directly or generated from a CSP page, which sends HTML back to the Web Gateway which sends it to the web server and back to the browser

Information Flow

The flow of information when a client requests information from a Web Application is as follows:

  1. An HTTP client, typically a web browser, requests a page from a web server using the standard HTTP protocol. All the leading servers are supported.

  2. The web server recognizes this as a CSP request and forwards it to the Web Gateway using a fast server API.

  3. The Web Gateway determines the InterSystems IRIS server to talk to and forwards requests to the CSP server on that target system.

  4. The CSP server running in InterSystems IRIS processes the request and returns a page to the Web Gateway, which passes it back to the web server.

  5. The web server sends it to the browser for display.

Static Files

The InterSystems IRIS database server serves all of CSP. It can also serve any kind of static file for a web application via the Web Gateway. In standard web applications, web servers (not database servers) typically serve static content.


If you are serving files containing Unicode text, CSP uses the BOM to determine the correct encoding to use. The BOM must be present in Unicode text files.

Enabling the Serve Files Option

The Serve Files option for a Web Application has the following values:

  • AlwaysServe Files is on.

  • No — Serve Files is off.

  • Always and cached — The Web Gateway can cache static files on the web server. This setting improves efficiency as the system can serve a cached static page without going back to the InterSystems IRIS server.

Configuring the Web Server to Allow Static Files to be Served by the InterSystems IRIS Server

By default, the installation script provided by InterSystems does not look for or configure an external web server. If you run a custom install, you can choose the option to configure any previously-installed IIS or Apache web server to enable CSP support. The installation script creates the /csp virtual directory and creates mappings for the .csp, .cls, .zen and .cxw extensions to be handled by the Web Gateway. This is sufficient for CSP to function normally via that web server. It does not enable support for the Serve Files feature. You must manually configure your web server to map specific file extensions to be handled via the Web Gateway. This is by design because opening the database server up to exposure via this mechanism is a security risk and should not be done invisibly.

See the section “Registering Additional File Types with CSP” in this book for instructions for your web server.

Serving Static Files from the Web Server

You can use a traditional configuration of serving static pages from the web server. In this case, the setting of the Static Files option is irrelevant. This eliminates contention when a common web server serves two different versions of InterSystems IRIS, each requiring different versions of certain static files, for example, hyperevent broker components.

If you have configured the web server itself to serve static files, be sure that the static content is present on every single web server.