In a message dated 4/12/05 10:06:54 AM, [EMAIL PROTECTED] writes:
thanks for all your responses! I'm sorry I wasn't too clear about my
problem. I don't want to cache the results of calling ns_adp_parse
-string $my_string since parts of the result page contain request
specific parts. What I wanted to know is if there is a way to parse, but
not evaluate $my_string. That way it is not reparsed on each request.
I went the cheap way now and simple write out $my_string to a file and
use ns_adp_file -file.
Hi,
There's a new, undocumented and lightly tested ADP caching mechanism in the head version of the code. It works by caching results of page executation on an ADP include with ns_adp_include. Simple usage would be:
ns_adp_include -cache ttl file
where ttl is an Ns_Time object (or just a number of seconds). Everything in the top level file and all included files below will be cached for the given time unless a lower level include has some other ttl or a -nocache to disable caching for that file, e.g. with:
ns_adp_include -cache 10 cachethis.inc
and within cachethis.inc you have:
ns_adp_include -nocache personalizedstuff.inc
then everything execept the personalized stuff would be cached for 10 seconds.
The key code is AdpRun in nsd/adpeval.c. Basically when caching, the results for executing text, script, text, script, ... chunks are saved for later requests as a single text block or at least fewer script blocks if lower level files are not cached. The usage may be a bit confusing and it caches around files, not strings, but the results are promising in tests we've done. In the limiting case of caching everything in an ADP file and below, you can turn multi-second database driven responses into quick single-string copy responses which generally respond in milliseconds.
-Jim
2">
- [AOLSERVER] Caching parsed ns_adp_parse -string results Olaf Mersmann
- Re: [AOLSERVER] Caching parsed ns_adp_parse -string re... Dossy Shiobara
- Re: [AOLSERVER] Caching parsed ns_adp_parse -string re... Tom Jackson
- Re: [AOLSERVER] Caching parsed ns_adp_parse -string re... Bas Scheffers
- Re: [AOLSERVER] Caching parsed ns_adp_parse -string re... Olaf Mersmann
- Jim Davidson
