[ PHPXref.com ] [ Generated: Sun Jul 20 16:25:17 2008 ] [ ActionApps 2.8.1b ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> cached.php3 (source)

   1  <?php
   2  /** Gets the content from the cache based on keystr
   3   *  This file is useful for storin external javascript files (used for client
   4   *  side speedup, because it is cached on client side
   5   *
   6   *  @package UserOutput
   7   *  @version $Id: cached.php3,v 1.2 2005/04/24 21:48:11 honzam Exp $
   8   *  @author Honza Malik <honza.malik@ecn.cz>
   9   *  @copyright Econnect, Honza Malik, October 2004
  10   *
  11   *  @param keystr = 32-characters long hexadecimal number of chache record
  12   */
  13  /*
  14  Copyright (C) 2002 Association for Progressive Communications
  15  http://www.apc.org/
  16  
  17      This program is free software; you can redistribute it and/or modify
  18      it under the terms of the GNU General Public License as published by
  19      the Free Software Foundation; either version 2 of the License, or
  20      (at your option) any later version.
  21  
  22      This program is distributed in the hope that it will be useful,
  23      but WITHOUT ANY WARRANTY; without even the implied warranty of
  24      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  25      GNU General Public License for more details.
  26  
  27      You should have received a copy of the GNU General Public License
  28      along with this program (LICENSE); if not, write to the Free Software
  29      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  30  */
  31  
  32  /** APC-AA configuration file */
  33  require_once  "./include/config.php3";
  34  /** Main include file for using session management function on page */
  35  require_once $GLOBALS['AA_INC_PATH']."locsess.php3";
  36  /** Caching functions */
  37  require_once $GLOBALS['AA_INC_PATH']."util.php3";
  38  require_once $GLOBALS['AA_INC_PATH']."pagecache.php3";
  39  
  40  // headers copied from include/extsess.php3 file
  41  $allowcache_expire = 24*3600; // 1 day
  42  $exp_gmt           = gmdate("D, d M Y H:i:s", time() + $allowcache_expire) . " GMT";
  43  $mod_gmt           = gmdate("D, d M Y H:i:s", getlastmod()) . " GMT";
  44  header('Expires: '       . $exp_gmt);
  45  header('Last-Modified: ' . $mod_gmt);
  46  header('Cache-Control: public');
  47  header('Cache-Control: max-age=' . $allowcache_expire);
  48  header('Content-Type application/x-javascript');
  49  
  50  echo $GLOBALS['pagecache']->getById($keystr);
  51  
  52  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]