ASPCACHE FREQUENTLY ASKED QUESTIONSIf your questions are not answered here, use our support form to ask us a question. Questions
Answers Can ASPCache be implemented without any recoding? No, implementing ASPCache does require some recoding. Data caching with ASPCache requires minimal conversion effort. Output caching requires a bit more recoding, but the performance gains easily justify the effort. To implement data caching with ASPCache, add the To implement whole page caching, we recommend using APGen. APGen 2.0 includes an ASPToAPG utility that does conversion for you. Page fragment caching with ASPCache does require recoding: The page fragment that you wish to cache needs to be moved to an APG script,
and replaced with a call to What additional load does ASPCache bring to the server? ASPCache is a component, not an ISAPI filter - consequently ASPCache adds no load to most requests. ISAPI filters add some load to every request, components only add load when they are called. When an ASPCache method is called from an ASP page, there is some load, but the load is much less than other caching and collection components. For performance numbers, see ASPCache Collection Performance. Is it possible to cache page fragments without using APGen? Yes, it is possible to cache page fragments without using APGen. Page fragments are just files, so you can generate them any way you want. You could use XMLHTTP to download the page fragment. You could use the FSO (FileSystem Object) to write a page fragment file. You can use XML and XSLT to generate page fragments. However, APGen generally works best because it offers easier page authoring and maintenance (similar to ASP). APGen was designed for scripted generation of Web pages and files, and will save you effort in all content generation tasks. Do you provide both sliding and absolute expiration parameters for cached items? ASPCache does not implement "sliding expiration". ASPCache does offer absolute expiration. However, a developer can effectively implement sliding expiration by setting the item's expiration every time it is accessed: <% When an item expires is it immediately removed? No, expired items are not immediately removed. Though immediate removal might be nice in some cases, it would add too much overhead for most cases. Items that have expired are removed in one of two ways: a) When the background flush/expire thread runs (you can set how often it
runs by setting b) If an expired item is retrieved, set, or otherwise accessed, and the background thread has not yet removed the item, it is removed and the method acts like the expired item wasn't there. This means that the item is removed at the first access after it has expired. The background flush thread is disabled by default (to minimize overhead). To enable background cleanup
of expired and underused items, set Does ASPCache have a persistence interface? No. We will implement persistence methods in ASPCache 2.0, including methods to persist and depersist to an XML string or XML file. We will also implement auto-loading. In the meantime, you can always iterate over the collection and save or restore its contents. Iteration over an ASPCache object is efficient. How does key size affect performance as the cache grows in size? ASPCache performs a hash on the key before insertion, lookup, and removal. The key is only scanned once per cache operation, so longer keys won't make much of a difference in overall performance. Also, key size makes no incremental difference as the cache grows. If we are running two applications on the Web server and we want to use ASPCache on each are they going to share the same cache? No. Each ASP application (with 1 global.asa file that instantiates an ASPCache object) can only access its own ASPCache(s). An ASP application can instantiate multiple ASPCache objects, but other ASP applications won't be able to access them. If you want to expose data in an ASPCache to other applications, one way is to write an ASP page that returns the cached data in XML. The client can use the XMLHttpRequest component to retrieve the data. Can you suggest a way that ASPCache can be used to cache XSL files? If you're performing the XSLT transforms on the server, the best performing architecture is to run the transforms once, then cache the output in ASPCache, so the overhead of one transform is spread across multiple requests. This is only viable if the XSLT output can be shared for multiple users. If each user receives different output (the XML input changes for each user), then use the XSLTemplate object to cache the compiled XSLT document. XSLTemplate objects can be stored in ASPCache. This isn't as efficient as caching the output, but it's better than re-compiling the XSL during every request. ASPCache can cache any COM object, but you should only cache FreeThreaded objects (like As a rule, caching anything is useful if it saves the Web server work. The more work that is saved, the more valuable caching is. If after you cache the XSLT output, you find that you're still parsing the XML or XSLT documents pretty often, and they're not changing, then you can further improve efficiency by caching the XML DOM or XSLTemplate objects. | |||