From: Stephen D. <sd...@gm...> - 2007-06-29 22:55:40
|
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. |
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 > |
From: Stephen D. <sd...@gm...> - 2007-06-29 23:25:47
|
On 6/30/07, Vlad Seryakov <vl...@cr...> wrote: > yes, all those cache/nocache and other weird optinos came with old > naviserver and some parts from new AS 4.5. It needs cleanup. Oh, forgot to ask. The -tcl option you added to ns_adp_include and ns_adp_parse, was this just for completeness during implementation or is this actually useful? You've never been able to do this with Tcl pages before, so it's not a backwards compatible thing. I think it would be really tricky to use this correctly. ADP pages have a buffer which is written into with ns_adp_append, ns_adp_puts, or conceptually with the text outside of <% %> tags. Tcl pages do not use that buffer, you write directly with ns_return, ns_write, etc. The two will not play together. How would you use ns_adp_include -tcl myfile.tcl ? The only thing I can think of is within an ADP page you want to include another page that is basically all Tcl script and you don't want to put <% at the very beginning and %> at the very end. It hardly seems worth it for the potential confusion. Can I remove the -tcl option or is there something I'm overlooking? > 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 > > > > > ------------------------------------------------------------------------- > 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 > |
From: Vlad S. <vl...@cr...> - 2007-06-29 23:50:20
|
no problem Stephen Deasey wrote: > On 6/30/07, Vlad Seryakov <vl...@cr...> wrote: >> yes, all those cache/nocache and other weird optinos came with old >> naviserver and some parts from new AS 4.5. It needs cleanup. > > > Oh, forgot to ask. The -tcl option you added to ns_adp_include and > ns_adp_parse, was this just for completeness during implementation or > is this actually useful? > > You've never been able to do this with Tcl pages before, so it's not a > backwards compatible thing. > > I think it would be really tricky to use this correctly. ADP pages > have a buffer which is written into with ns_adp_append, ns_adp_puts, > or conceptually with the text outside of <% %> tags. Tcl pages do not > use that buffer, you write directly with ns_return, ns_write, etc. > The two will not play together. > > How would you use ns_adp_include -tcl myfile.tcl ? > > The only thing I can think of is within an ADP page you want to > include another page that is basically all Tcl script and you don't > want to put <% at the very beginning and %> at the very end. > > It hardly seems worth it for the potential confusion. Can I remove the > -tcl option or is there something I'm overlooking? > > >> 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 >>> >> >> ------------------------------------------------------------------------- >> 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 >> > > ------------------------------------------------------------------------- > 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 > |