Index: openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl,v diff -u -r1.10.2.33 -r1.10.2.34 --- openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl 14 Sep 2022 12:29:45 -0000 1.10.2.33 +++ openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl 12 Oct 2022 17:05:10 -0000 1.10.2.34 @@ -74,7 +74,7 @@ # # NaviServer variant # - :public method eval {{-partition_key} {-expires:integer} key command} { + :public method eval {{-partition_key} {-expires:integer} {-per_request:switch} key command} { # # Evaluate the command unless it is cached. # @@ -86,9 +86,17 @@ } else { set expires_flag {} } + set cache_name [:cache_name $partition_key] try { - :uplevel [list ns_cache_eval {*}$expires_flag -- \ - [:cache_name $partition_key] $key $command] + if {$per_request} { + acs::per_request_cache eval -key ::acs-${cache_name}($key) { + :uplevel [list ns_cache_eval {*}$expires_flag -- \ + $cache_name $key $command] + } + } else { + :uplevel [list ns_cache_eval {*}$expires_flag -- \ + $cache_name $key $command] + } } on break {r} { #