1

If I do:

{% set cacheKey = block.id %}
{% cache using key cacheKey if craft.app.config.general.cache %}
    {% for item in items %}

        <div class="swiper-slide ais-hits--item" data-id="{{ item.id }}">

            {% set object = (block.contentType == 'events') ? item.show.one : item %}

            {% include '_blocks/blockCard/blockCard' with {
                content: object,
                blockId: block.id
            } %}

            {% include '_blocks/blockCardPreview/blockCardPreview' with {
                content: object,
                blockId: block.id
            } %}

        </div>


    {% endfor %}
{% endcache %}

I get an error saying

PHP Warning – yii\base\ErrorException Error while sending QUERY packet. PID=881

If I remove the using key cacheKey part it works. But of course al the sliders have the same content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.