Mac OS X Server 10.2 and Later: Learn about Web Performance Cache
The Web Performance Cache interacts with various Web server functions. This document explains how it is configured by default, which may assist you when configuring Mac OS X Server Web services.
Except where noted, this information applies to Mac OS X Server 10.2 or later.
Important notes about Web Performance Cache
The Web Performance Cache is enabled by default on Mac OS X Server 10.3 or later. It improves the performance of the Web server under certain circumstances, but you should be aware of the following:
When the Web Performance Cache is enabled for any virtual hosts, a process named webperfcache runs, and takes over the listener on the configured TCP port (usually port 80). The Apache Web server is then configured to listen on a different TCP port (usually port 16080). All requests are received by the webperfcache process, and they are either served from the in-memory cache, or they are relayed to the Apache Web server. In the latter case, the Web Performance Cache then receives a response from the Apache Web server, saves it in its in-memory cache (if it can be cached and caching is enabled for that virtual host), and returns the response to the requester.
The Web Performance Cache is not compatible with Apache's connection KeepAlive mechanism. By default, the KeepAlive mechanism is disabled and cannot be controlled by the Server Admin application. If you want to enable KeepAlive for your websites, you must use a text editor to change the KeepAlive setting in /etc/httpd/httpd.conf and use Server Admin to disable Web Performance Cache for all your websites.
If a request contains Cookie headers, Web Performance Cache considers the request uncacheable and does not cache any responses for that request.
Web Performance Cache respects the expiration times of cacheable items such as images, audio, and video files. By default these are all configured to expire after one hour. If you are running a busy website with Web Performance Cache enabled, and you notice a heavier load on your Apache Web server once per hour, it may be due to the image, audio, and video files all expiring at once. You may be able to flatten the load profile by staggering the expiration times of these file types. These are controlled by Apache's ExpiresByType directive. This directive is not configurable with the Server Admin application, so you'd need to use a text editor to edit /etc/httpd/httpd.conf.
Mac OS X Server 10.3 or later only: Web Performance Cache is started at system startup by the Apache startup item, based on the setting of WEBPERFCACHESERVER in /etc/hostconfig.
Web Performance Cache is not compatible with SSL. You should not enable both Web Performance Cache and SSL for a specific site. Doing so keeps Apache from starting.
The amount of RAM WebPerfCache uses for its cache is determined by the WebPerfCacheRAMAvailable setting in the webperfcache.conf file, if present. That directive is commented out in the default version of this configuration file, so WebPerfCache will use all the physical RAM for its cache.
Note that WebPerfCache can use a maximum of 2097151 KB of RAM for its cache. If a computer has 2G or more of physical RAM, WebPerfCache will not be able to determine the proper amount of memory to use for its cache. In that case, you must specify a value for WebPerfCacheRAMAvailable in the /etc/webperfcache/webperfcache.conf file. The maximum usable value is:
WebPerfCacheRAMAvailable 2097151
Performance Cache must be disabled if you wish to serve files larger than 2GB via HTTP/Apache. When Web Performance Cache is enabled, downloads larger than 2GB in size get truncated to 2GB.
When running PHP or other dynamic web page generation, Web Performance Cache can cause the performance of dynamically generated content to be slower. While the Performance Cache will improve the performance of static content, you should disable the Performance Cache when using the server primarily for dynamic content.
Additional information about the Web Performance Cache can be found in its configuration file: /etc/webperfcache/webperfcache.conf