mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-22 15:42:54 +02:00
One can now add a HTTP header for Cache-Control in the config file, #109.
This commit is contained in:
@@ -928,6 +928,18 @@ $cachePath = getConfig('cache_path', __DIR__ . '/../cache/');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the cachepath from config.
|
||||
*/
|
||||
$cacheControl = getConfig('cache_control', null);
|
||||
|
||||
if ($cacheControl) {
|
||||
verbose("cacheControl = $cacheControl");
|
||||
$img->addHTTPHeader("Cache-Control", $cacheControl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Prepare a dummy image and use it as source image.
|
||||
*/
|
||||
|
@@ -140,6 +140,16 @@ return array(
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add header for cache control when outputting images.
|
||||
*
|
||||
* Default value:
|
||||
* cache_control: null, or set to string
|
||||
*/
|
||||
//'cache_control' => "max-age=86400",
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The name representing a dummy image which is automatically created
|
||||
* and stored at the defined path. The dummy image can then be used
|
||||
|
Reference in New Issue
Block a user