From: Vlad S. <vl...@cr...> - 2007-06-29 23:00:40
|
yes, all those cache/nocache and other weird optinos came with old naviserver and some parts from new AS 4.5. It needs cleanup. But i do not like new AS 4.5 config syntax, looks ugly Stephen Deasey wrote: > ns_adp_include takes the new -cache and -nocache options. -nocache is > a boolean which suppresses caching. -cache takes an integer number of > seconds which is the amount of time the result of evaluating the ADP > code should be cached. > > I think a better name for -cache would be -expires. We already use > this terminology for ns_cache_eval and friends. -cache and -nocache > look like two opposite boolean states, but cache actually takes an > argument of seconds. > > (Hmm, do we need -nocache? Should -expires 0 mean 'no-cache', expires > immediately, or does that look like 'never-expires'?) > > Currently you pass a TTL to -cache, the time to live in seconds. > -expires should support that. But it should also accept an absolute > time in the future for consistency with -timeout etc., the semantics > of which we've discussed in the past. > > > ns_register_adp and ns_register_tcl also take a -cache option, which > should also be changed (I added these, taking the lead from > ns_adp_include). Interestingly AOLserver 4.5 has changed the config > file syntax for marking which pages should be parsed as ADP: > > ns_section "ns/server/server1/adp" > ns_param map [list /yada/*.adp 1200] > > The page can now be a two element list with the second element being a > ttl. With the -cache option to ns_register_adp (which AOLserver > doesn't have) this config style can be neatly handled here: > > http://naviserver.cvs.sourceforge.net/naviserver/naviserver/tcl/config.tcl?revision=1.2&view=markup#l_123 > > But here's the question: would it be better to add -expires to > ns_limits? It already handles -timeout. > > http://www.crystalballinc.com/vlad/software/naviserver/files/mann/ns_limits.html > > I wasn't sure at first but it's making more sense the more I think > about it. The -expires limit would be a hint to any command which has > some caching ability to, if not explicitly given a value, use the > expiry from the per-url limit. > > Does this make sense? > > I ask this now because it changes API. For the future, it might be > nice (and seems easy enough) to also add HTTP caching headers to the > output if an expiry is given. So, not only do we output cache, but the > browser won't bother sending if-modified-since requests. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > |