Skip to content

cstudiossro/turbo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turbo plugin for Craft CMS 3.x

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.