mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-17 08:31:38 +00:00
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:
parent
7236429eed
commit
ff124c0a75
@ -1274,18 +1274,17 @@ object.Constructor('Page', BasePage, {
|
|||||||
var CachedPage =
|
var CachedPage =
|
||||||
module.CachedPage =
|
module.CachedPage =
|
||||||
object.Constructor('CachedPage', Page, {
|
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...
|
// NOTE: set this to null/undefined/0 to disable...
|
||||||
cache_timeout: '20m',
|
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(){
|
get cache(){
|
||||||
this.chechCache(this.path)
|
this.chechCache(this.path)
|
||||||
return ((this.cachestore ?? {})[this.path] ?? {}).value },
|
return ((this.cachestore ?? {})[this.path] ?? {}).value },
|
||||||
|
|||||||
@ -348,7 +348,8 @@ store.update('Settings',
|
|||||||
// XXX not yet sure how to organize the actual client -- UI, hooks, .. etc
|
// XXX not yet sure how to organize the actual client -- UI, hooks, .. etc
|
||||||
var pwiki =
|
var pwiki =
|
||||||
module.pwiki =
|
module.pwiki =
|
||||||
page.Page('/', '/', store)
|
//page.Page('/', '/', store)
|
||||||
|
page.CachedPage('/', '/', store)
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user