So basically I have something like this in my routes.php:
Route::get('/book/{page?}', array(
'as' => 'book',
'uses' => 'BookController@book'
));
Based on {page?} that's provided the Controller gets the information from the database to create the Blade View. The controller code is pretty involved and a lot of stuff is done here. However once the Controller has provided the information for the Blade View. It only changes, say once a month, because that's when the database gets updated and the Controller has to do it's thing again.
My question is, what's a good way to cache the Blade View or what the Controller did to speed up load time?
Also I'm using Ajax so I can't just cache the whole page.
public function book($page = '') {
$sets = $this->parseSetDetails($page);
return parent::ajaxView('mtg.book', compact('sets'));
}
Blade views are automatically cached at least in L 5 as you can see in storage or somewhere cached views. If not check some caching libraries on the net
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community