Caching of static content improves performance by eliminating file I/O. You configure the static page cache at the server level, as described in “Static Page Caching” in the EAServer System Administration Guide. Follow these guidelines to get the best performance from your cache:
Exclude seldom-used files Review your server’s request logs and identify files that are rarely requested. These files should be excluded from cache, so that when requested, they do not cause more frequently requested content to be removed from the cache.
Tune the timeout value The cache timeout value determines how long an entry can remain in cache before EAServer checks for updated content on disk. If you post a new version of a cached file, clients receive the old version from cache until the timeout expires or you flush the cache. Configure the timeout to allow content updates while minimizing the occurrence of cache misses. You can also configure the server to never timeout (using a very large value), and use the following strategy to post updated content:
Post updated content at regular intervals.
After posting, flush the static page cache using EAServer Manager or by running a client that calls the flushStaticPageCache method in the Jaguar::Management component.
Tune the cache size The cache size must be sufficient to cache the most frequently requested content (assuming you have excluded seldom-requested files). To estimate the required size, calculate the total size of your static content files, minus the size of excluded files, then multiply by your required hit/miss ratio.
When the cache is tuned, you can further improve the speed at which static page contents are served by disabling the HTTP request log (using the HTTP Config properties in the Server Properties dialog box). However, consider this option carefully as the request data can be helpful to diagnose performance problems that arise from changes in your configuration or user interests. For example, you may find newly posted content creates a large spike in the request pattern. The request log helps you identify popular content that you should add to the cache.
Copyright © 2005. Sybase Inc. All rights reserved. |