I'm trying to using craft caching to cache a page without query string vars.

This tag

{% cache using key craft.request.path  %}

{% endcache %}

throws an error

Unexpected token "name" of value "using" ("end of statement block" expected)

This example is right from the Craft Docs, https://craftcms.com/docs/templating/cache

If I remove the "using ..." everything works fine.

Any ideas?

  • Works fine for me locally? Can you share the surrounding template code? Maybe some other template code is contributing to the error. Also, what's the URL look like when you get the error?
    – Brad Bell
    Dec 1 '14 at 18:35

Make sure you're running the latest version of Craft. using key didn't come until Craft 2.2.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.