Skip to content
Snippets Groups Projects
Commit 1a365a69 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Wrapper for images support a parameter cache=1 to increase speed for some pages.

parent fba4111f
Branches
Tags
No related merge requests found
<?php
/* 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>
*
* This program is free software; you can redistribute it and/or modify
......@@ -52,6 +52,20 @@ function llxHeader() { }
require("./main.inc.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
$type = 'application/octet-stream';
if (! empty($_GET["type"])) $type=$_GET["type"];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment