increase cache time

This commit is contained in:
Alex Grintsvayg 2016-09-02 15:50:47 -04:00
parent 115bfbadf4
commit d62fc57bad
2 changed files with 6 additions and 6 deletions

View file

@ -93,7 +93,7 @@ class Controller
$newsPattern = '#^' . ContentActions::URL_NEWS . '(/|$)#'; $newsPattern = '#^' . ContentActions::URL_NEWS . '(/|$)#';
if (preg_match($newsPattern, $uri)) if (preg_match($newsPattern, $uri))
{ {
Response::enableHttpCache(180); Response::enableHttpCache();
$slug = preg_replace($newsPattern, '', $uri); $slug = preg_replace($newsPattern, '', $uri);
if ($slug == ContentActions::RSS_SLUG) if ($slug == ContentActions::RSS_SLUG)
{ {
@ -105,7 +105,7 @@ class Controller
$faqPattern = '#^' . ContentActions::URL_FAQ . '(/|$)#'; $faqPattern = '#^' . ContentActions::URL_FAQ . '(/|$)#';
if (preg_match($faqPattern, $uri)) if (preg_match($faqPattern, $uri))
{ {
Response::enableHttpCache(180); Response::enableHttpCache();
$slug = preg_replace($faqPattern, '', $uri); $slug = preg_replace($faqPattern, '', $uri);
return $slug ? ContentActions::executeFaqPost($uri) : ContentActions::executeFaq(); return $slug ? ContentActions::executeFaqPost($uri) : ContentActions::executeFaq();
} }
@ -113,7 +113,7 @@ class Controller
$bountyPattern = '#^' . BountyActions::URL_BOUNTY_LIST . '(/|$)#'; $bountyPattern = '#^' . BountyActions::URL_BOUNTY_LIST . '(/|$)#';
if (preg_match($bountyPattern, $uri)) if (preg_match($bountyPattern, $uri))
{ {
Response::enableHttpCache(180); Response::enableHttpCache();
$slug = preg_replace($bountyPattern, '', $uri); $slug = preg_replace($bountyPattern, '', $uri);
return $slug ? BountyActions::executeShow($uri) : BountyActions::executeList($uri); return $slug ? BountyActions::executeShow($uri) : BountyActions::executeList($uri);
} }
@ -128,7 +128,7 @@ class Controller
$noSlashUri = ltrim($uri, '/'); $noSlashUri = ltrim($uri, '/');
if (View::exists('page/' . $noSlashUri)) if (View::exists('page/' . $noSlashUri))
{ {
Response::enableHttpCache(180); Response::enableHttpCache();
return ['page/' . $noSlashUri, []]; return ['page/' . $noSlashUri, []];
} }
else else

View file

@ -10,7 +10,7 @@ class ContentActions extends Actions
public static function executeHome(): array public static function executeHome(): array
{ {
Response::enableHttpCache(180); Response::enableHttpCache();
return ['page/home', [ return ['page/home', [
'totalUSD' => CreditApi::getTotalDollarSales(), 'totalUSD' => CreditApi::getTotalDollarSales(),
'totalPeople' => CreditApi::getTotalPeople() 'totalPeople' => CreditApi::getTotalPeople()
@ -161,7 +161,7 @@ class ContentActions extends Actions
$zip->close(); $zip->close();
Response::enableHttpCache(180); Response::enableHttpCache();
Response::setDownloadHttpHeaders($zipFileName, 'application/zip', filesize($zipPath)); Response::setDownloadHttpHeaders($zipFileName, 'application/zip', filesize($zipPath));
return ['internal/zip', [ return ['internal/zip', [