From 3db891800bb10c050f07f3e111c9cfc9cf707ac6 Mon Sep 17 00:00:00 2001 From: Robin Malley Date: Wed, 28 Jul 2021 00:39:04 +0000 Subject: [PATCH] Improve cacheing Caches domain/a and author.domain/a as the same page. --- src/lua/cache.lua | 1 + src/lua/endpoints/read_get.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua/cache.lua b/src/lua/cache.lua index 57fe6ac..244d6cf 100644 --- a/src/lua/cache.lua +++ b/src/lua/cache.lua @@ -17,6 +17,7 @@ local stmnt_cache, stmnt_insert_cache, stmnt_dirty_cache local oldconfigure = configure function configure(...) local cache = util.sqlassert(sql.open_memory()) + ret.cache = cache -- Expose db for testing --A cache table to store rendered pages that do not need to be --rerendered. In theory this could OOM the program eventually and start --swapping to disk. TODO: fixme diff --git a/src/lua/endpoints/read_get.lua b/src/lua/endpoints/read_get.lua index 354f094..b13c098 100644 --- a/src/lua/endpoints/read_get.lua +++ b/src/lua/endpoints/read_get.lua @@ -1,4 +1,4 @@ -local sql = require("sqlite3") +local sql = require("lsqlite3") local session = require("session") local tags = require("tags") @@ -151,7 +151,6 @@ local function read_get(req) table.insert(params,"pwd=" .. hashstr) end local cachestrparts = { - ps.host, ps.path, } if #params > 0 then