Extra cache dirtying
Some pages weren't getting dirtied appropriately on change.
This commit is contained in:
parent
f88ec0e22a
commit
4913e7765e
|
@ -92,6 +92,7 @@ local function edit_post(req)
|
||||||
cache.dirty(string.format("%s/%s",config.domain,id_enc)) -- This place to read this post
|
cache.dirty(string.format("%s/%s",config.domain,id_enc)) -- This place to read this post
|
||||||
cache.dirty(string.format("%s",config.domain)) -- The site index (ex, if the author changed the paste from their's to "Anonymous", the cache should reflect that).
|
cache.dirty(string.format("%s",config.domain)) -- The site index (ex, if the author changed the paste from their's to "Anonymous", the cache should reflect that).
|
||||||
cache.dirty(string.format("%s.%s",author,config.domain)) -- The author's index, same reasoning as above.
|
cache.dirty(string.format("%s.%s",author,config.domain)) -- The author's index, same reasoning as above.
|
||||||
|
cache.dirty(string.format("%s-logout",config.domain))
|
||||||
http_response_header(req,"Location",loc)
|
http_response_header(req,"Location",loc)
|
||||||
http_response(req,303,"")
|
http_response(req,303,"")
|
||||||
return
|
return
|
||||||
|
|
|
@ -112,7 +112,8 @@ local function index_get(req)
|
||||||
end)
|
end)
|
||||||
elseif host == config.domain and author then
|
elseif host == config.domain and author then
|
||||||
--Display home page with "log out" button
|
--Display home page with "log out" button
|
||||||
text = cache.render(config.domain .. "-logout", function()
|
local cachepath = string.format("%s-logout",config.domain)
|
||||||
|
text = cache.render(cachepath, function()
|
||||||
return get_site_home(req,true)
|
return get_site_home(req,true)
|
||||||
end)
|
end)
|
||||||
elseif host ~= config.domain and author ~= subdomain then
|
elseif host ~= config.domain and author ~= subdomain then
|
||||||
|
|
|
@ -148,6 +148,7 @@ local function author_paste(req,ps)
|
||||||
cache.dirty(string.format("%s.%s",author,config.domain))
|
cache.dirty(string.format("%s.%s",author,config.domain))
|
||||||
cache.dirty(string.format("%s/%s",config.domain,url))
|
cache.dirty(string.format("%s/%s",config.domain,url))
|
||||||
cache.dirty(string.format("%s",config.domain))
|
cache.dirty(string.format("%s",config.domain))
|
||||||
|
cache.dirty(string.format("%s-logout",config.domain))
|
||||||
end
|
end
|
||||||
http_response_header(req,"Location",loc)
|
http_response_header(req,"Location",loc)
|
||||||
http_response(req,303,"")
|
http_response(req,303,"")
|
||||||
|
|
|
@ -8,6 +8,7 @@ local util = require("util")
|
||||||
local cache = require("cache")
|
local cache = require("cache")
|
||||||
local pages = require("pages")
|
local pages = require("pages")
|
||||||
local config = require("config")
|
local config = require("config")
|
||||||
|
local zlib = require("zlib")
|
||||||
|
|
||||||
local stmnt_read, stmnt_update_views, stmnt_comments
|
local stmnt_read, stmnt_update_views, stmnt_comments
|
||||||
|
|
||||||
|
@ -175,6 +176,12 @@ local function read_get(req)
|
||||||
text = pages.read(ps)
|
text = pages.read(ps)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--If this isn't unlisted, dirty everywhere the hit counter is shown
|
||||||
|
cache.dirty(string.format("%s",config.domain))
|
||||||
|
cache.dirty(string.format("%s/%s",config.domain,ps.idp)) -- This place to read this post
|
||||||
|
cache.dirty(string.format("%s/%s",config.domain,ps.idp)) -- The author's index page
|
||||||
|
|
||||||
assert(text)
|
assert(text)
|
||||||
http_response(req,200,text)
|
http_response(req,200,text)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue