HandlerPageView: Drop partial caches
Anonymous access is the common case, this is already cached. For other cases this logic cannot be justified as there is hardly a practical gain for that extra complexity.
This commit is contained in:
parent
2102cf4e6b
commit
0cad11004f
@ -186,36 +186,8 @@ Response HandlerPageView::handleRequest(PageDao &pageDao, std::string pagename,
|
|||||||
dynamicVarsMap["createdon"] = utils::toISODate(firstRevision.value().timestamp);
|
dynamicVarsMap["createdon"] = utils::toISODate(firstRevision.value().timestamp);
|
||||||
|
|
||||||
std::string resolvedContent = parser.parseDynamics(revision->content, dynamicParseCallback);
|
std::string resolvedContent = parser.parseDynamics(revision->content, dynamicParseCallback);
|
||||||
if(revisionid > 0)
|
indexcontent = createIndexContent(parser, resolvedContent);
|
||||||
{
|
parsedcontent = parser.parse(pageDao, *this->urlProvider, resolvedContent);
|
||||||
indexcontent = createIndexContent(parser, resolvedContent);
|
|
||||||
parsedcontent = parser.parse(pageDao, *this->urlProvider, resolvedContent);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::string cachekeyindexcontent = "page:indexcontent:" + pagename;
|
|
||||||
std::string cachekeyparsedcontent = "page:parsedcontent:" + pagename;
|
|
||||||
auto cachedindexcontent = this->cache->get(cachekeyindexcontent);
|
|
||||||
auto cachedparsedcontent = this->cache->get(cachekeyparsedcontent);
|
|
||||||
if(cachedindexcontent)
|
|
||||||
{
|
|
||||||
indexcontent = *cachedindexcontent;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
indexcontent = createIndexContent(parser, resolvedContent);
|
|
||||||
this->cache->put(cachekeyindexcontent, indexcontent);
|
|
||||||
}
|
|
||||||
if(cachedparsedcontent)
|
|
||||||
{
|
|
||||||
parsedcontent = *cachedparsedcontent;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
parsedcontent = parser.parse(pageDao, *this->urlProvider, resolvedContent);
|
|
||||||
this->cache->put(cachekeyparsedcontent, parsedcontent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::string revisionstr = std::to_string(revision->revision);
|
std::string revisionstr = std::to_string(revision->revision);
|
||||||
std::string customtitle = parser.extractCommand("pagetitle", revision->content);
|
std::string customtitle = parser.extractCommand("pagetitle", revision->content);
|
||||||
page.setVar("content", parsedcontent);
|
page.setVar("content", parsedcontent);
|
||||||
|
Loading…
Reference in New Issue
Block a user