summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 13:57:36 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 13:57:36 +0100
commit8f3b7be2e1130a94cf4de5e9e1b5a18d382efff8 (patch)
tree037d5b9a24fc85300619ab488675b202d52b5533
parent63927c35611bf56a1fce03750e953ec5250fb282 (diff)
downloadmorph-cache-server-8f3b7be2e1130a94cf4de5e9e1b5a18d382efff8.tar.gz
Use "Cache-Control: no-cache" to avoid caching of /sha1s results.
Resolving a ref may result in a different SHA1 between any two requests, so we simply should never allow the results to be cached by an HTTP cache.
-rwxr-xr-xmorph-cache-server1
1 files changed, 1 insertions, 0 deletions
diff --git a/morph-cache-server b/morph-cache-server
index b13241b..60c3105 100755
--- a/morph-cache-server
+++ b/morph-cache-server
@@ -47,6 +47,7 @@ class MorphCacheServer(cliapp.Application):
repo = self._unescape_parameter(request.query.repo)
ref = self._unescape_parameter(request.query.ref)
try:
+ response.set_header('Cache-Control', 'no-cache')
sha1 = repo_cache.resolve_ref(repo, ref)
return {
'repo': '%s' % repo,