mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Merge pull request #1470 from pixelfed/frontend-ui-refactor
Update SiteController, increase cache TTL
This commit is contained in:
commit
0b282a7e90
1 changed files with 8 additions and 7 deletions
|
@ -42,7 +42,7 @@ class SiteController extends Controller
|
||||||
|
|
||||||
public function about()
|
public function about()
|
||||||
{
|
{
|
||||||
return Cache::remember('site:about', now()->addMinutes(120), function() {
|
return Cache::remember('site:about', now()->addHours(12), function() {
|
||||||
$page = Page::whereSlug('/site/about')->whereActive(true)->first();
|
$page = Page::whereSlug('/site/about')->whereActive(true)->first();
|
||||||
$stats = [
|
$stats = [
|
||||||
'posts' => Status::whereLocal(true)->count(),
|
'posts' => Status::whereLocal(true)->count(),
|
||||||
|
@ -64,24 +64,25 @@ class SiteController extends Controller
|
||||||
|
|
||||||
public function communityGuidelines(Request $request)
|
public function communityGuidelines(Request $request)
|
||||||
{
|
{
|
||||||
|
return Cache::remember('site:help:community-guidelines', now()->addDays(120), function() {
|
||||||
$slug = '/site/kb/community-guidelines';
|
$slug = '/site/kb/community-guidelines';
|
||||||
$page = Page::whereSlug($slug)->whereActive(true)->first();
|
$page = Page::whereSlug($slug)->whereActive(true)->first();
|
||||||
return view('site.help.community-guidelines', compact('page'));
|
return View::make('site.help.community-guidelines')->with(compact('page'))->render();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function privacy(Request $request)
|
public function privacy(Request $request)
|
||||||
{
|
{
|
||||||
return Cache::remember('site:privacy', now()->addMinutes(120), function() {
|
return Cache::remember('site:privacy', now()->addDays(120), function() {
|
||||||
$slug = '/site/privacy';
|
$slug = '/site/privacy';
|
||||||
$page = Page::whereSlug($slug)->whereActive(true)->first();
|
$page = Page::whereSlug($slug)->whereActive(true)->first();
|
||||||
return View::make('site.privacy')->with(compact('page'))->render();
|
return View::make('site.privacy')->with(compact('page'))->render();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function terms(Request $request)
|
public function terms(Request $request)
|
||||||
{
|
{
|
||||||
return Cache::remember('site:terms', now()->addMinutes(120), function() {
|
return Cache::remember('site:terms', now()->addDays(120), function() {
|
||||||
$slug = '/site/terms';
|
$slug = '/site/terms';
|
||||||
$page = Page::whereSlug($slug)->whereActive(true)->first();
|
$page = Page::whereSlug($slug)->whereActive(true)->first();
|
||||||
return View::make('site.terms')->with(compact('page'))->render();
|
return View::make('site.terms')->with(compact('page'))->render();
|
||||||
|
|
Loading…
Reference in a new issue