summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 17848fc)
raw | patch | inline | side by side (parent: 17848fc)
author | Jakub Narebski <jnareb@gmail.com> | |
Sat, 26 Aug 2006 17:14:25 +0000 (19:14 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 26 Aug 2006 20:56:09 +0000 (13:56 -0700) |
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 2db99c360086498fc3cca1d409e08c8e9aa28f90..0df59af821248103cde84a4969439f56a98a9457 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
sub git_blob_plain {
+ # blobs defined by non-textual hash id's can be cached
+ my $expires;
+ if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = "+1d";
+ }
+
if (!defined $hash) {
if (defined $file_name) {
my $base = $hash_base || git_get_head_hash($project);
$save_as .= '.txt';
}
- print $cgi->header(-type => "$type",
- -content_disposition => "inline; filename=\"$save_as\"");
+ print $cgi->header(
+ -type => "$type",
+ -expires=>$expires,
+ -content_disposition => "inline; filename=\"$save_as\"");
undef $/;
binmode STDOUT, ':raw';
print <$fd>;
}
sub git_blob {
+ # blobs defined by non-textual hash id's can be cached
+ my $expires;
+ if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
+ $expires = "+1d";
+ }
+
if (!defined $hash) {
if (defined $file_name) {
my $base = $hash_base || git_get_head_hash($project);
close $fd;
return git_blob_plain($mimetype);
}
- git_header_html();
+ git_header_html(undef, $expires);
my $formats_nav = '';
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
if (defined $file_name) {