diff options
Diffstat (limited to 'src/couchdb/couch_httpd_misc_handlers.erl')
-rw-r--r-- | src/couchdb/couch_httpd_misc_handlers.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index fb761f5b..2d67b321 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -38,7 +38,14 @@ handle_welcome_req(Req, _) -> send_method_not_allowed(Req, "GET,HEAD"). handle_favicon_req(#httpd{method='GET'}=Req, DocumentRoot) -> - couch_httpd:serve_file(Req, "favicon.ico", DocumentRoot); + {{Year,Month,Day},Time} = erlang:localtime(), + OneYearFromNow = {{Year+1,Month,Day},Time}, + CachingHeaders = [ + %favicon should expire a year from now + {"Cache-Control", "public, max-age=31536000"}, + {"Expires", httpd_util:rfc1123_date(OneYearFromNow)} + ], + couch_httpd:serve_file(Req, "favicon.ico", DocumentRoot, CachingHeaders); handle_favicon_req(Req, _) -> send_method_not_allowed(Req, "GET,HEAD"). |