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

Feature request: flush cache on Global set update #1

Open
hellonicolas opened this issue Jan 23, 2014 · 2 comments
Open

Feature request: flush cache on Global set update #1

hellonicolas opened this issue Jan 23, 2014 · 2 comments

Comments

@hellonicolas
Copy link

Hi there! It took me some tweaking, but I think I finally figured out how to use Stow.

In addition to Entry/Entries, it'd be great if updating a Global set (or sets!) could also trigger flushing the cache.

Not sure if Craft makes it possible to do this with Globals, but I figured I'd ask :) Thanks!

@sathoro
Copy link
Owner

sathoro commented Jan 29, 2014

I will be including this shortly, stay tuned

@hellonicolas
Copy link
Author

Awesome, thanks! I ended up hacking into the plugin quite a bit to get some stuff working for my current setup – like adding some methods to clear out caching and even the option to store the caches as static JSON files (instead of in the DB).

I also added a Craft Event listener in a custom plugin (that handles other site-specific things for me) that wipes out the Stow cache on these events:

  • entries.onSaveEntry
  • globals.onSaveGlobalContent

In my specific use-case, the most convenient method was to just wipe it all out anytime content is updated.

I'd be happy to share the code if you're interested, but I can't guarantee it's pretty ;)

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

No branches or pull requests

2 participants