Q. How does Active Cache work and how do I get started?
A. Active Cache works by loading cached html directly into the response stream. To enabled caching on an existing asp page, use the Read method to check for a cached page. If a cache file is found, it will be written directly into the response stream and no more page processing will occur. If a cache file is not found procesing will continue. You will need to use the Cache method to save the page to cache at the bottom of your page.
Examples can be found in the examples folder included with the installation and in the Implementing a caching system with Active Cache for ASP Part One white paper.
Q. What is an Instanceid and why do I need to use it?
A. The instance id is a unique number or value identifying a multiple versions of the same page in the cache. The instance id is required so that the right version of the page is returned to the client.
In some instances an ASP page is used simply to render content from a database and only a single version exists. In this case you do not need to use an instance id. This scenario is most common in content management applications.
Q. I installed the product and I get the error message 'Automation error The server process could not be started because the configured identity is incorrect. Check the username and password' when creating the PageCache object.
A. Active Cache uses a separate process to read and write cache files and to access the system. This runs in the COM+ runtime to ensure both security and performance. The identity under which the process needs to be configured to a user with permissions to read and write files and to create directories in your web, for example the local administrator of the machine. To change these settings, follow the instructions in the readme.txt in the Active Cache program files directory, or contact support@crainiate.com.
Q. What is the difference between Page and Page Fragment caching?
A. It is always best to try and cache an entire page as this will bring the most performance benefits. Sometimes however there is a requirement to cache a portion or multiple sections of the page instead. When only a portion of the page is cached, we call this a page fragment. Page fragments can be read by using the ReadFragment method. An important difference to note between the Read and the ReadFragment method is that the ReadFragment method returns control to the ASP page. You will need to check the return value to see whether you need to process the fragment or not. Calls to the cache method will look for the first preceding Read or ReadFragment method to determine the page fragment to cache.
Q. How do I license my Active Cache Software?
A. The Active Cache evaluation is fully functional. However it will write an evaluation message to the response stream until your purchase a license. To enter a license key, click the registration node in the Active Cache Administration MMC snapin. Enter your key and click the Save button
Click here to view license key purchasing options.
Q. When we are in a testing environment we need to turn of the caching. Is there any way to do this without branching the code in the ASP file?
A. Set the 'enable caching' combo to false in the Active Cache Administration MMC snapin.
Q. Do you have any example code? How do I view the examples?
A. There are 2 examples ASP pages included with the installation, prime.asp and primefragment.asp. These files demonstrate using page and page fragment caching with the page cache component. These files need to be copied into an existing web, or a new web needs to be created. Refresh the page to see the cache results.
The Implementing a caching system with Active Cache for ASP Part One white paper is also a good place to start.
Q. I have an external content management application that updates my live content, which is then rendered using an ASP page and Active Cache. I need to be able to expire the cache page as soon as the content changes from this application. How do I do this?
A. There are 2 approaches to this problem. The first approach would be to call the expire method from the relevant page to clean the cache for all the relevant page cache files. This could be achieved by using a flag in the page querystring to signify that you would like to expire the page eg www.site.com/index.asp?EX=True
The second approach would be to delete the cache files in the _cache directory of the page directory corresponding to that page name. For example a page called index.asp in the directory c:\inetpub\wwwroot\index.asp will have a corresponding cache directory c:\inetpub\wwwroot\_cache. Delete all cache files beginning with the string 'index'.
Q. What's the maximum length of the "fragmentid" used for the cache file?
A. An .asp page cache file is created on disk using a name which is the combination of the asp file name and the fragment id. This filename can only be in the region of 225 characters in windows file system.