225a2cc8a1
Upped the user cache capacity and topic cache capacity. More resource management work. WIP. Added Hyperdrive to the experimental folder. It doesn't really work right now, but I'd like to track it's progress. Eliminated a line in global.js
35 lines
730 B
Go
35 lines
730 B
Go
// Highly experimental plugin for caching rendered pages for guests
|
|
package main
|
|
|
|
import (
|
|
"sync/atomic"
|
|
|
|
"./common"
|
|
)
|
|
|
|
var hyperPageCache *HyperPageCache
|
|
|
|
func init() {
|
|
common.Plugins.Add(&common.Plugin{UName: "hyperdrive", Name: "Hyperdrive", Author: "Azareal", Init: initHyperdrive, Deactivate: deactivateHyperdrive})
|
|
}
|
|
|
|
func initHyperdrive() error {
|
|
hyperPageCache = newHyperPageCache()
|
|
common.Plugins["hyperdrive"].AddHook("somewhere", deactivateHyperdrive)
|
|
return nil
|
|
}
|
|
|
|
func deactivateHyperdrive() {
|
|
hyperPageCache = nil
|
|
}
|
|
|
|
type HyperPageCache struct {
|
|
topicList atomic.Value
|
|
}
|
|
|
|
func newHyperPageCache() *HyperPageCache {
|
|
pageCache := new(HyperPageCache)
|
|
pageCache.topicList.Store([]byte(""))
|
|
return pageCache
|
|
}
|