на хук style-fetch вешается код
Код:
if (!$vbulletin->userinfo['userid']){
if((THIS_SCRIPT == 'showthread' AND !empty($threadinfo)) OR (THIS_SCRIPT == 'forumdisplay' AND !empty($foruminfo)))
{
if(THIS_SCRIPT == 'showthread' AND !empty($threadinfo))
{
if($threadinfo['lastpost'])
{
$LastModified_unix = $threadinfo['lastpost'];
$LastModified = gmdate("D, d M Y H:i:s \G\M\T", $LastModified_unix);
$IfModifiedSince = false;
if(isset($_ENV['HTTP_IF_MODIFIED_SINCE']))
{
$IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5));
}
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
{
$IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5));
}
if($IfModifiedSince AND $IfModifiedSince >= $LastModified_unix)
{
@header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
exit;
}
@header('Last-Modified: '. $LastModified);
}
}
else if(THIS_SCRIPT == 'forumdisplay' AND !empty($foruminfo))
{ $lastposta=$vbulletin->db->query_first("select lastpost from vbforum where forumid=".$foruminfo['forumid']);
$LastModified_unix = $lastposta['lastpost'];
$LastModified = gmdate("D, d M Y H:i:s \G\M\T", $LastModified_unix);
$IfModifiedSince = false;
if(isset($_ENV['HTTP_IF_MODIFIED_SINCE']))
{
$IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5));
}
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
{
$IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5));
}
if($IfModifiedSince AND $IfModifiedSince >= $LastModified_unix)
{
@header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
exit;
}
@header('Last-Modified: '. $LastModified);
}
}
}
необходимо так же добавить в fastcgi_params передачу HTTP_IF_MODIFIED_SINCE. Проверить можно тут: