couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject [1/2] git commit: Futon Cache-Control
Date Wed, 09 Nov 2011 10:29:49 GMT
Updated Branches:
  refs/heads/master 7e3c69ba9 -> 68c0f5a70


Futon Cache-Control

Specify that paths under /_utils be served with Cache-Control headers:
 - private: so permissions on dbs aren't violated by caching proxies
 - must-revalidate: so we don't serve a stale futon

The revalidation is particularly useful for developers, but might also
serve to prevent stale versions of documents being shown accidentally.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/68c0f5a7
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/68c0f5a7
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/68c0f5a7

Branch: refs/heads/master
Commit: 68c0f5a705b5b367a5b59337158b66288671f1e6
Parents: 7bc22f9
Author: Randall Leeds <randall@apache.org>
Authored: Thu Oct 20 15:34:37 2011 -0700
Committer: Randall Leeds <randall@apache.org>
Committed: Wed Nov 9 02:18:28 2011 -0800

----------------------------------------------------------------------
 src/couchdb/couch_httpd_misc_handlers.erl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/68c0f5a7/src/couchdb/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index ae6ffe3..38dd98e 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -61,7 +61,9 @@ handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) ->
     case couch_httpd:partition(UrlPath) of
     {_ActionKey, "/", RelativePath} ->
         % GET /_utils/path or GET /_utils/
-        couch_httpd:serve_file(Req, RelativePath, DocumentRoot);
+        CachingHeaders =
+                [{"Cache-Control", "private, must-revalidate"}],
+        couch_httpd:serve_file(Req, RelativePath, DocumentRoot, CachingHeaders);
     {_ActionKey, "", _RelativePath} ->
         % GET /_utils
         RedirectPath = couch_httpd:path(Req) ++ "/",


Mime
View raw message