Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key parameter for Cache tag #2589

Merged
merged 1 commit into from
Oct 6, 2020
Merged

key parameter for Cache tag #2589

merged 1 commit into from
Oct 6, 2020

Conversation

duncanmcclean
Copy link
Member

This pull request adds the ability for a developer to specify the cache key they want to use when using Statamic's {{ cache }} tag.

Instead of Statamic creating a random cache key, a developer can specify it with the key param.

{{ cache key="the_alphabet" }}
a b c d e f g h i j k l m n o p q r s t u v w x y z
{{ /cache }}

This PR implements statamic/ideas#349.

@jasonvarga
Copy link
Member

I know this is exactly what that issue described, but I wonder if or how we should handle the scope parameter along with this.

If you were to have {{ cache key="something" scope="page" }}... should it work? If so, how would you flush it?
Or should we just say if you use the key param, you're on your own. The scope param has no effect.

@jasonvarga
Copy link
Member

We decided what you're doing is great. 👍

@jasonvarga jasonvarga merged commit 80d532a into statamic:master Oct 6, 2020
@duncanmcclean duncanmcclean deleted the feature/cache-key-param branch October 6, 2020 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants