К недостаткам относится только возможная небольшая задержка получения информации.
- Код: Выделить всё
##############################################################
## MOD Title: Index Cache MOD
## MOD Author: chyduskam < chuduskam@debilarius.ru > (Egor Naklonyaeff) N/A
## MOD Description: Cashe index page on user computer for 3 min
## MOD Version: 0.0.1
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 2
## index.php
## includes/page_header.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbbguru.net/mods/
##############################################################
## Author Notes: It's work!!!
##############################################################
## MOD History:
## 2005-04-01 - Version 0.0.1
## - initial release
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]-------------------------------------------------------
#
index.php
#
#-----[ FIND ]----------------------------------------
#
define('IN_PHPBB', true);
#
#-----[ BEFORE, ADD ]----------------------------------
#
// Begin HTTP Header MOD
if(isset($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']))
{
$deadline=strtotime($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']);
if((time()-$deadline)<180)
{
if(function_exists("getallheaders")) header('HTTP/1.1 304 Not Modified');
else header('Status: 304 Not Modified');
if(isset($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE'])) header("Last-Modified: ".$HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']);
if(isset($HTTP_SERVER_VARS['HTTP_IF_NONE_MATCH'])) header("Etag: ".$HTTP_SERVER_VARS['HTTP_IF_NONE_MATCH']);
exit;
}
}
define('PHPBB_HEADER',time());
// End HTTP Header MOD
#
#-----[ OPEN ]-------------------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]----------------------------------------
#
header ('Expires: 0');
header ('Pragma: no-cache');
#
#-----[ REPLACE WITH ]----------------------------------
#
// Begin HTTP Header MOD
if(defined('PHPBB_HEADER'))
{
$MyETag='"phpBB'.gmdate("YmdHis", PHPBB_HEADER).'"';
$MyGMTtime=gmdate("D, d M Y H:i:s", PHPBB_HEADER)." GMT";
header("Last-Modified: ".$MyGMTtime);
header("Etag: ".$MyETag);
header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");
}
else
{
header ('Expires: 0');
header ('Pragma: no-cache');
}
// End HTTP Header MOD
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM




