mirror of
https://github.com/mrclay/minify.git
synced 2025-08-11 16:44:44 +02:00
option changed to "setExpires"
default missing minifier is none (no minification performed)
This commit is contained in:
@@ -80,13 +80,13 @@ class HTTP_ConditionalGet {
|
||||
? 'public'
|
||||
: 'private';
|
||||
// allow far-expires header
|
||||
if (isset($spec['cacheUntil'])) {
|
||||
if (is_numeric($spec['cacheUntil'])) {
|
||||
$spec['cacheUntil'] = self::gmtdate($spec['cacheUntil']);
|
||||
if (isset($spec['setExpires'])) {
|
||||
if (is_numeric($spec['setExpires'])) {
|
||||
$spec['setExpires'] = self::gmtdate($spec['setExpires']);
|
||||
}
|
||||
$this->headers = array(
|
||||
'Cache-Control' => $scope
|
||||
,'Expires' => $spec['cacheUntil']
|
||||
,'Expires' => $spec['setExpires']
|
||||
);
|
||||
$this->cacheIsValid = false;
|
||||
return;
|
||||
|
@@ -4,14 +4,14 @@ require '../../ConditionalGet.php';
|
||||
|
||||
// far expires
|
||||
$cg = new HTTP_ConditionalGet(array(
|
||||
'cacheUntil' => (time() + 86400 * 365) // 1 yr
|
||||
'setExpires' => (time() + 86400 * 365) // 1 yr
|
||||
));
|
||||
$cg->sendHeaders();
|
||||
|
||||
// generate, send content
|
||||
$title = 'Expires date is known';
|
||||
$explain = '
|
||||
<p>Here we set "cacheUntil" to a timestamp or GMT date string. This results in
|
||||
<p>Here we set "setExpires" to a timestamp or GMT date string. This results in
|
||||
<code>$cacheIsValid</code> always being false, so content is always served, but
|
||||
with an Expires header.
|
||||
<p><strong>Note:</strong> This isn\'t a conditional GET, but is useful if you\'re
|
||||
|
Reference in New Issue
Block a user