now the cache is storred on the .root page and shared by all decendents...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-22 12:31:19 +03:00
parent 7236429eed
commit ff124c0a75
2 changed files with 10 additions and 10 deletions

View File

@ -1274,18 +1274,17 @@ object.Constructor('Page', BasePage, {
var CachedPage =
module.CachedPage =
object.Constructor('CachedPage', Page, {
// XXX should this always refer to .render_root.cachestore
cachestore: undefined,
/*/
get cachestore(){
return (this.render_root ?? this).__cachestore },
set cachestore(value){
;(this.render_root ?? this).__cachestore = value },
//*/
// NOTE: set this to null/undefined/0 to disable...
cache_timeout: '20m',
// keep all the cache in one place -- .root
//__cachestore: undefined,
get cachestore(){
return (this.root ?? this).__cachestore },
set cachestore(value){
;(this.root ?? this).__cachestore = value },
get cache(){
this.chechCache(this.path)
return ((this.cachestore ?? {})[this.path] ?? {}).value },

View File

@ -348,7 +348,8 @@ store.update('Settings',
// XXX not yet sure how to organize the actual client -- UI, hooks, .. etc
var pwiki =
module.pwiki =
page.Page('/', '/', store)
//page.Page('/', '/', store)
page.CachedPage('/', '/', store)
//---------------------------------------------------------------------