- fix: Caching (last-modified bug) (misja / E-Wise)

This commit is contained in:
JT Smith 2007-03-28 18:45:59 +00:00
parent 9b3a18405a
commit c70bf5c256
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,8 @@
7.3.14
- fix: Duplicate Metadata (perlDreamer Consulting, LLC)
- fix: fixed double conversion into seconds (seconds were being stored, and
then multiplied by 86400) in group expirations
- fix: Caching (last-modified bug) (misja / E-Wise)
- fix: calender (thanks to TjECC for suggesting a very elegant way to fix
this)
http://www.plainblack.com/bugs/tracker/calender#TKMNSvU-0qlmsv3aNk5W7g

View file

@ -266,7 +266,6 @@ sub sendHeader {
$request->content_type($self->getMimeType || "text/html; charset=UTF-8");
my $cacheControl = $self->getCacheControl;
my $date = ($userId eq "1") ? $datetime->epochToHttp($self->getLastModified) : $datetime->epochToHttp;
$request->headers_out->set('Last-Modified' => $date);
# under these circumstances, don't allow caching
if ($userId ne "1" || $cacheControl eq "none" || $self->session->setting->get("preventProxyCache")) {
$request->headers_out->set("Cache-Control" => "private, max-age=1");
@ -274,6 +273,7 @@ sub sendHeader {
}
# in all other cases, set cache, but tell it to ask us every time so we don't mess with recently logged in users
else {
$request->headers_out->set('Last-Modified' => $date);
$request->headers_out->set('Cache-Control' => "must-revalidate, max-age=" . $cacheControl);
# do an extra incantation if the HTTP protocol is really old
if ($request->protocol =~ /(\d\.\d)/ && $1 < 1.1) {