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

Conditional caching #439

Closed
perdjurner opened this issue Dec 19, 2014 · 2 comments
Closed

Conditional caching #439

perdjurner opened this issue Dec 19, 2014 · 2 comments
Milestone

Comments

@perdjurner
Copy link
Contributor

You should be able to specify something to be added to cache keys so we can cache multiple versions depending on the variables passed in to create the key (typical example being if the user is logged in or not).

Implementation could be something like this (from "init"):

caches(action="home", addToKey="request.loggedIn")

request.loggedIn is just a string here, the actual value of it will be used whenever we get / set the cache.

@perdjurner
Copy link
Contributor Author

Would also be good if we can can just skip caching completely based on a condition.

@timsayshey
Copy link

Okay, I made a quick plugin-- just added a couple conditions to check for session.user -
https://gist.github.com/timsayshey/72f0eef154bf7ac972b1

It will get me by until we get something nicer implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants