Caching
Caching can substantially increase your web server's performance in delivering both pages and images to browsers. TeleFinder's caching lets it serve files directly from memory rather than fetching the file from disk. This can be especially important on PowerPC systems where disk access goes through the 68K emulator.TeleFinder's caching employs an optimized "Least Recently Used" (LRU) algorithm to maintain the and update the cache contents. This ensures that the most frequently requested files can be served directly from memory. The cache's LRU automatically detects changes in request patterns and reassigns cache priority accordingly.
Which Systems Benefit
Caching will benefit your system's performance if the system has one of the following characteristics:
- Systems serving an Intranet or high-speed Internet connection.
- Systems serving large numbers of hits, or have servers that experience periods of high hit density.
- Systems that serve documents from file servers, or slow media.
Setting up the Cache
Caching requires extra memory. You need to decide how much memory you want to allocate to the file cache and increase TeleFinder's application memory size by that amount. Then you will allocate that memory to a fixed number of file "slots" in the cache.At the time of this writing our server (www.spiderisland.com) has 2Mb allocated for caching files. Since we have a relatively large number of files to serve we created 128 slots in the cache, each with a maximum size of 16Kb (128 times 16 Kb= 2048Kb, or 2 Mb). Using these settings the TeleFinder is able to serve nearly 75% of all hits from the cache, dramatically improving the site's overall performance.
Select the "Server Settings" command from the Web menu to open the settings dialog. Then click on the "Cache" icon to display the cache pane.
Max Files
Then input the maximum number of files you want to cache in the "Max Files" field. TeleFinder will cache information for the number of files entered here.Max Size
This is the maximum size of a cacheable file (Kb). Files larger than this will not be cached.The total amount of memory needed for caching is Max Files times Max Size.
File Info "Time-To-Live"
Input the time duration (in seconds) you want TeleFinder to hold file information in memory. After this timer expires, TeleFinder will get updated information from the file system and start the timer again.If the file's Last Modified date has changed when the timer expires, TeleFinder reloads the new data. Otherwise the existing data is kept.
Honor "No-Cache" Requests
Turn this on when you want TeleFinder to refresh its cache from disk if necessary whenever the browser makes the request with the "Pragma: No-Cache" header. This header is sent when the user makes the request using the browser's "Reload" button.Monitoring Performance
Two commands are available for monitoring the performance of the cache.Cache Stats this displays the number of hits served from the cache, and the number served from disk. (Note: CGI and Plug-In hits are not included in these figures. )
Keep in mind that any hits from the cache are better than none. You can increase the percentage by allocating more slots and/or increasing the slot size.
List Files in Web Cache this displays the full path names of the files currently in the cache in order of priority.
As the cache settles in, the "hit" rate will increase over time and usually level off. Wait for the hit rate to level off before changing the settings again.
Reloading Files
Manual reloading of files is unnecessary with TeleFinder's caching system. If you change a page in your web site, TeleFinder will automatically reload the new data into it's cache within the "Time-To-Live" settings, or immediately if you make the request using the browsers "Reload" button.
Changing settings
The cache is flushed whenever you change any of TeleFinder's Web Server settings. This reduces the effectiveness of the cache since files now need to be reloaded.
May 14, 1997 -- ©Copyright 1997, Spider Island Software