Add caching for network sections and add indexes for order tables

This commit is contained in:
2024-02-07 17:15:24 +01:00
parent c7c16830f7
commit 1aaa6f6907
2 changed files with 52 additions and 1 deletions

View File

@@ -125,7 +125,12 @@ class Network extends mfBaseModel {
}
if($name == "sections") {
$this->sections = NetworksectionModel::search(['network_id' => $this->id]);
$cache_key = "network_".$this->id."_sections";
$this->sections = mfValuecache::singleton()->get($cache_key);
if($this->sections === NULL) {
$this->sections = NetworksectionModel::search(['network_id' => $this->id]);
mfValuecache::singleton()->set($cache_key, $this->sections);
}
return $this->sections;
}