From: Jakub Narebski <jnareb@gmail.com>
To: "W. Trevor King" <wking@drexel.edu>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v8 3/3] gitweb: add If-Modified-Since handling to git_snapshot().
Date: Fri, 30 Mar 2012 17:07:54 +0100 [thread overview]
Message-ID: <201203301807.55284.jnareb@gmail.com> (raw)
In-Reply-To: <bfbde5354e25dfbf535307a72016a6b5ac3a2c56.1333024238.git.wking@drexel.edu>
On Thu, 29 Mar 2012, W. Trevor King wrote:
> Because snapshots can be large, you can save some bandwidth by
> supporting caching via If-Modified-Since. This patch adds support for
> the i-m-s request to git_snapshot() if the request is a commit.
>
Perhaps it is worth clarifying that "caching" here means external HTTP
caching, either by web browser, or by web accelerator / reverse proxy.
Supporting Last-Modified and If-Modified-Since helps that[1][2].
[1]: http://www.mnot.net/cache_docs/#VALIDATE
[2]: http://www.mnot.net/cache_docs/#SCRIPT
> Requests for snapshots of trees, which lack well defined timestamps,
> are still handled as they were before.
"still handled as they were before" means "do not support l-m / i-m-s",
isn't it? Wouldn't it be better to write it explicitely?
>
> Signed-off-by: W Trevor King <wking@drexel.edu>
Anyway, I like those changes:
Acked-by: Jakub Narebski <jnareb@gmail.com>
[...]
> +test_expect_success 'modification: tree snapshot' '
> + ID=`git rev-parse --verify HEAD^{tree}` &&
> + export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" &&
> + test_when_finished "unset HTTP_IF_MODIFIED_SINCE" &&
> + gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
> + grep "Status: 200 OK" gitweb.headers &&
> + ! grep -i "last-modified" gitweb.headers
If we ignore case, we can write
+ ! grep -i "Last-Modified:" gitweb.headers
which is IMVVVHO slightly more readable.
Not that it matters much. Just nitpicking.
> +'
> +test_debug 'cat gitweb.headers'
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2012-03-30 16:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120328164513.GA4389@odin.tremily.us>
2012-03-28 17:44 ` [PATCH v7 0/3] gitweb: refactor If-Modified-Since handling W. Trevor King
2012-03-28 17:44 ` [PATCH v7 1/3] gitweb: add `status` headers to git_feed() responses W. Trevor King
2012-03-28 17:44 ` [PATCH v7 2/3] gitweb: refactor If-Modified-Since handling W. Trevor King
2012-03-28 17:44 ` [PATCH v7 3/3] gitweb: add If-Modified-Since handling to git_snapshot() W. Trevor King
2012-03-28 18:11 ` Jakub Narebski
2012-03-28 18:37 ` W. Trevor King
2012-03-28 19:11 ` Junio C Hamano
2012-03-28 19:27 ` W. Trevor King
2012-03-28 21:45 ` Jakub Narebski
2012-03-28 21:28 ` Jakub Narebski
2012-03-29 12:45 ` [PATCH v8 0/3] gitweb: refactor If-Modified-Since handling W. Trevor King
2012-03-29 12:45 ` [PATCH v8 1/3] gitweb: add `status` headers to git_feed() responses W. Trevor King
2012-03-30 15:21 ` Jakub Narebski
2012-03-29 12:45 ` [PATCH v8 2/3] gitweb: refactor If-Modified-Since handling W. Trevor King
2012-03-30 15:30 ` Jakub Narebski
2012-03-29 12:45 ` [PATCH v8 3/3] gitweb: add If-Modified-Since handling to git_snapshot() W. Trevor King
2012-03-30 16:07 ` Jakub Narebski [this message]
2012-03-30 16:11 ` [PATCH v8 0/3] gitweb: refactor If-Modified-Since handling Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201203301807.55284.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=wking@drexel.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).