mirror of
https://github.com/flextype/flextype.git
synced 2025-08-26 06:24:32 +02:00
feat(admin-plugin): YAML parsing will be cached in production #263
This commit is contained in:
@@ -83,8 +83,7 @@ class Parser
|
||||
|
||||
break;
|
||||
default:
|
||||
return FrontmatterParser::encode($input);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -105,8 +104,8 @@ class Parser
|
||||
if ($cache) {
|
||||
$key = md5($input);
|
||||
|
||||
if ($this->flextype['cache']->contains($key)) {
|
||||
return $this->flextype['cache']->fetch($key);
|
||||
if ($data_from_cache = $this->flextype['cache']->fetch($key)) {
|
||||
return $data_from_cache;
|
||||
}
|
||||
|
||||
$data = FrontmatterParser::decode($input);
|
||||
@@ -122,8 +121,8 @@ class Parser
|
||||
if ($cache) {
|
||||
$key = md5($input);
|
||||
|
||||
if ($this->flextype['cache']->contains($key)) {
|
||||
return $this->flextype['cache']->fetch($key);
|
||||
if ($data_from_cache = $this->flextype['cache']->fetch($key)) {
|
||||
return $data_from_cache;
|
||||
}
|
||||
|
||||
$data = JsonParser::decode($input);
|
||||
@@ -139,8 +138,8 @@ class Parser
|
||||
if ($cache) {
|
||||
$key = md5($input);
|
||||
|
||||
if ($this->flextype['cache']->contains($key)) {
|
||||
return $this->flextype['cache']->fetch($key);
|
||||
if ($data_from_cache = $this->flextype['cache']->fetch($key)) {
|
||||
return $data_from_cache;
|
||||
}
|
||||
|
||||
$data = YamlParser::decode($input);
|
||||
|
Reference in New Issue
Block a user