fixed a bug in cache control
fixed a bug in snippet added more of the default 7.0 content
This commit is contained in:
parent
3bc44928b3
commit
4f0727ba40
3 changed files with 126 additions and 3 deletions
|
|
@ -172,7 +172,7 @@ sub view {
|
|||
my $output = $self->get("snippet");
|
||||
WebGUI::Macro::process($self->session,\$output);
|
||||
$output = $self->getToolbar.$output if ($self->session->var->get("adminOn") && !$calledAsWebMethod);
|
||||
unless ($self->getValue("processAsTemplate")) {
|
||||
if ($self->getValue("processAsTemplate")) {
|
||||
$output = WebGUI::Asset::Template->processRaw($self->session, $output);
|
||||
}
|
||||
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
|
||||
|
|
|
|||
|
|
@ -215,10 +215,10 @@ sub setCacheControl {
|
|||
if ($timeout eq "none" || $self->session->setting->get("preventProxyCache")) {
|
||||
$self->session->request->no_cache(1);
|
||||
} elsif ($request->protocol =~ /(\d\.\d)/ && $1 >= 1.1){
|
||||
$request->header_out('Cache-Control', "max-age=" . $timeout);
|
||||
$request->headers_out->set('Cache-Control' => "max-age=" . $timeout);
|
||||
} else {
|
||||
my $date = $self->session->datetime->epochToHuman(time() + $timeout, "%W, %d %C %y %j:%m:%s %t");
|
||||
$request->header_out('Expires', $date);
|
||||
$request->headers_out->set('Expires' => $date);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue