{% block cache_key %}
    {% set cacheKey = hook.query %}
    {% set cacheKey = cacheKey|merge({'script': 'cache-script'}) %}

    {% do hook.setCacheKey(cacheKey|md5) %}
{% endblock %}

{% block response %}
    {% do debug.dump('some debug information') %}

    {% set response = services.response.json({ 'foo': 'bar' }) %}
    {% do response.cache.tag('my-custom-tag') %}
    {% do response.cache.invalidationState('logged-in') %}

    {% do hook.setResponse(response) %}
{% endblock %}
