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

Adds action triggers to cache flush methods - Allows Cachify flushing to be extended #294

Merged
merged 7 commits into from
Jun 22, 2024

Conversation

ouun
Copy link
Contributor

@ouun ouun commented Nov 3, 2023

I tried to extend Cachify with hooks to handle additional API requests to an edge cache. However, I ended up with some very hacky solutions as there are no action hooks available at the end of the cache flush/delete logics.

This PR simply adds two action triggers to the two main cache flush methods, which I hope I have identified correctly. It allows for any other callback functions to be added after the entire cache or a single cache item has been deleted.

I really hope you agree with this and that it can be merged with the 2.4.0 release. Redis support and these hooks will make Cachify even more flexible and powerful. Thanks for your great work!

@ouun ouun changed the title Adds action triggers to cache flush methods. - Allows Cachify flushing to be extended. Adds action triggers to cache flush methods - Allows Cachify flushing to be extended Nov 3, 2023
@pluginkollektiv pluginkollektiv deleted a comment from sonarcloud bot Mar 29, 2024
Copy link

sonarcloud bot commented Mar 29, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@stklcode
Copy link
Contributor

While being pretty much self-explaining and matching calling method's names, I find the hook names little long.

Maybe something like cachify_flushed_page and cachify_flushed_total? Or simply keep the long names, I only have a weak personal opinion on this one...

@stklcode stklcode added this to the 2.4.0 milestone Mar 29, 2024
@stklcode stklcode self-requested a review June 22, 2024 08:34
@stklcode stklcode merged commit bcb0141 into pluginkollektiv:develop Jun 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants