cstudios/turbo

This plugin utilizes the PageCache filter from yii2 into your craft 3 instance

1.4.2 2022-06-07 13:10 UTC

This package is auto-updated.

Last update: 2024-05-07 17:10:25 UTC


README

This plugin utilizes the PageCache filter from yii2 into your craft 3 instance

Screenshot

Logo partially made by monkik from www.flaticon.com

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later. This plugins also supports Craft 4.

Installation

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

Note:

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.