summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-04-04 22:42:54 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-04-06 21:33:58 +0300
commitd43ffcfaa959d1f3875c61521c231251305b98db (patch)
tree2b09f508e679753e4f8f3cdfa03faf360c7031ae
parent71ec12236998fb58caa11d535ea269d556b419c2 (diff)
downloadaconf-d43ffcfaa959d1f3875c61521c231251305b98db.tar.bz2
aconf-d43ffcfaa959d1f3875c61521c231251305b98db.tar.xz
server: prevent caching
-rw-r--r--server.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/server.lua b/server.lua
index 17a93c3..5a3f081 100644
--- a/server.lua
+++ b/server.lua
@@ -7,6 +7,7 @@ local aconf = require('aconf')
local mbin = aconf.model.binary
local mnode = aconf.model.node
local isinstance = aconf.object.isinstance
+local update = require('aconf.util').update
local json = require('cjson')
local posix = require('posix')
@@ -24,6 +25,14 @@ local sessions = {}
return function(env)
local function wrap(code, headers, res, encode)
if not headers then headers = {} end
+ update(
+ headers,
+ {
+ ['Cache-Control']='no-cache, no-store, must-revalidate',
+ Pragma='no-cache',
+ Expires='0'
+ }
+ )
if res then
local ctype