Wrapper for images support a parameter cache=1 to increase speed for some pages.
This commit is contained in:
parent
fba4111f44
commit
1a365a69c8
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -52,6 +52,20 @@ function llxHeader() { }
|
|||||||
require("./main.inc.php");
|
require("./main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||||
|
|
||||||
|
|
||||||
|
if (GETPOST("cache"))
|
||||||
|
{
|
||||||
|
// Important: Following code is to avoid page request by browser and PHP CPU at
|
||||||
|
// each Dolibarr page access.
|
||||||
|
if (empty($dolibarr_nocache))
|
||||||
|
{
|
||||||
|
header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||||
|
header('Pragma: cache'); // This is to avoid having Pragma: no-cache
|
||||||
|
}
|
||||||
|
else header('Cache-Control: no-cache');
|
||||||
|
//print $dolibarr_nocache; exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Define mime type
|
// Define mime type
|
||||||
$type = 'application/octet-stream';
|
$type = 'application/octet-stream';
|
||||||
if (! empty($_GET["type"])) $type=$_GET["type"];
|
if (! empty($_GET["type"])) $type=$_GET["type"];
|
||||||
@ -276,7 +290,7 @@ if ($modulepart)
|
|||||||
$accessallowed=1;
|
$accessallowed=1;
|
||||||
$original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file;
|
$original_file=$conf->scanner->dir_temp.'/'.$user->id.'/'.$original_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapping pour les images fckeditor
|
// Wrapping pour les images fckeditor
|
||||||
elseif ($modulepart == 'fckeditor')
|
elseif ($modulepart == 'fckeditor')
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user