-
Notifications
You must be signed in to change notification settings - Fork 5
page cache
Vitor Hugo edited this page Oct 9, 2019
·
1 revision
Atualize o arquivo de configurações (no homestead está em /etc/nginx/sites-available/nome-do-host)
location = / {
try_files /page-cache/pc__index__pc.html /index.php?$query_string;
}
location / {
try_files $uri $uri/ /page-cache/$uri.html /index.php?$query_string;
}
Abra public/.htaccess e adicione as linhas abaixo antes do bloco nomeado Handle Front Controller:
# Serve Cached Page If Available...
RewriteCond %{REQUEST_URI} ^/?$
RewriteCond %{DOCUMENT_ROOT}/page-cache/pc__index__pc.html -f
RewriteRule .? page-cache/pc__index__pc.html [L]
RewriteCond %{DOCUMENT_ROOT}/page-cache%{REQUEST_URI}.html -f
RewriteRule . page-cache%{REQUEST_URI}.html [L]
Acrescente na rota a middleware turbo
Ex.
Route::get('/', 'FrontendController@index')->name('frontend.index')->middleware('turbo');