{% import "_includes/forms" as forms %}

{% set info %}
    <span class="info">{{ "The folder path should be in the site’s public webroot if the cached files should be publicly available."|t('blitz') }}</span>
{% endset %}
{{ forms.autosuggestField({
    label: "Folder Path"|t('blitz'),
    instructions: "The path to your cache folder."|t('blitz') ~ info,
    suggestEnvVars: true,
    suggestAliases: true,
    name: 'folderPath',
    value: driver.folderPath,
    errors: driver.getErrors('folderPath'),
    placeholder: '@webroot/cache/blitz',
    tip: "It is highly recommended to exclude the cache folder path from search engine indexing via a [`robots.txt`](https://www.robotstxt.org/robotstxt.html) file."|t('blitz'),
    required: true,
}) }}

{% set info %}
    <span class="info">{{ 'With this setting enabled, Blitz will compress cached files using gzip and write them to `index.html.gz` files for improved performance (requires extra code in server rewrites). <a href="{url}" class="go" target="_blank">Learn more</a>'|t('blitz', {url: 'https://putyourlightson.com/plugins/blitz#server-rewrites'})|raw }}</span>
{% endset %}
{{ forms.lightswitchField({
    label: "Create Gzip Files"|t('blitz'),
    instructions: "Whether compressed versions of cached files should be created using gzip."|t('blitz') ~ info,
    name: 'createGzipFiles',
    on: driver.createGzipFiles,
}) }}

{% set info %}
    <span class="info">{{ 'With this setting enabled, Blitz will compress cached files using brotli and write them to `index.html.br` files for improved performance (requires that the Brotli PHP extension is installed and extra code in server rewrites). <a href="{url}" class="go" target="_blank">Learn more</a>'|t('blitz', {url: 'https://putyourlightson.com/plugins/blitz#server-rewrites'})|raw }}</span>
{% endset %}
{{ forms.lightswitchField({
    label: "Create Brotli Files"|t('blitz'),
    instructions: "Whether compressed versions of cached files should be created using brotli."|t('blitz') ~ info,
    name: 'createBrotliFiles',
    on: driver.createBrotliFiles,
}) }}

<p class="light">
    {{ 'Use server rewrites for significant performance improvements. <a href="{url}" class="go" target="_blank">Learn more</a>'|t('blitz', {url: 'https://putyourlightson.com/plugins/blitz#server-rewrites'})|raw }}
</p>
