This plugin utilizes the PageCache filter from yii2 into your craft 3 instance
This plugin requires Craft CMS 3.0.0-beta.23 or later. This plugins also supports Craft 4.
composer require cstudios/turbo
And add the following lines to your app.php
or app.web.php
config file
'components' => [
'view' => [
'class' => 'craft\web\View',
'allowEval' => true
]
]
You can now exclude urls using the following configuration ( inside your app.php
file )
'params' => [
'turbo' => [
'excludedUrls' => [
'/index',
'/channel/*'
]
]
]
You can use wildcarded urls as well with the asterisk (*) character
If you have some dynamic contents on your site, you want to be excluded from page caching then you can use the following code:
{{ craft.turbo.renderDynamic('csrfInput()') | raw }}
To make it easier for you, we've already implemented csrfInput into this plugin, so you just have to use:
{{ craft.turbo.csrfInput() | raw }}
Brought to you by Gergely Horvath
Supported by ❤️ Cstudios s.r.o.