Cache & If-Modified-Since

This commit is contained in:
JT Smith 2007-09-07 17:55:34 +00:00
parent 0248dde02f
commit 0993cba3e9
3 changed files with 84 additions and 24 deletions

View file

@ -203,6 +203,24 @@ sub getStreamedFile {
}
#-------------------------------------------------------------------
=head2 ifModifiedSince ( epoch )
Returns 1 if the epoch is greater than the modified date check.
=cut
sub ifModifiedSince {
my $self = shift;
my $epoch = shift;
require APR::Date;
my $modified = $self->session->request->headers_in->{'If-Modified-Since'};
return 1 if ($modified eq "");
$modified = APR::Date::parse_http($modified);
return ($epoch > $modified);
}
#-------------------------------------------------------------------
=head2 isRedirect ( )