8000 Rename `invalidate-tags` command as `clear-tags`? · Issue #45711 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Rename invalidate-tags command as clear-tags? #45711

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

Closed
javiereguiluz opened this issue Mar 11, 2022 · 5 comments
Closed

Rename invalidate-tags command as clear-tags? #45711

javiereguiluz opened this issue Mar 11, 2022 · 5 comments
Labels
Milestone

Comments

@javiereguiluz
Copy link
Member

Description

In #44692 we added a cache:pool:invalidate-tags command in addition to the existing cache:pool:clear command.

I think invalidate is too long and uncommon ... besides being inconsistent with the existing clear command.

Even in the proposed docs of this feature (symfony/symfony-docs#16328) we use the "clear" word to explain the command:

docs

So, should we rename cache:pool:invalidate-tags as cache:pool:clear-tags ?

Thanks!

Example

No response

@kbond
Copy link
Member
kbond commented Mar 11, 2022

I used "invalidate" because of the TagAwareCacheInterface::invidateTags() method. Note, this doc uses the term "invalidation" instead of "clear". Maybe symfony/symfony-docs#16328 should use the term invalidate as well? Also, I know there has been a proposal for a specific cache:pool:invalidate command - to invalidate a specific key or keys.

That all being said, I don't have a strong opinion on this.

@javiereguiluz
Copy link
Member Author

Thanks for your comments Kevin. I see this is more complex than it looked at first.

Technically speaking, what does the cache:pool:invalidate command do?

(1) Turns the tags as invalid, but items are still stored in the cache (but invalid) until they are actually cleared later.
(2) Turns the tags as invalid and immediately deletes all the items tagged with them.

To me, (1) is "invalidate" and (2) is "clear".

@kbond
Copy link
Member
kbond commented Mar 11, 2022

Good point, I'm not actually sure if it's 1 or 2. @nicolas-grekas could probably answer this.

Also, I know there has been a proposal for a specific cache:pool:invalidate command - to invalidate a specific key or keys.

I think if this were added, we would call cache:pool:delete to match the interface method. (I was trying to find another place we'd use the term invalidate but this isn't it).

@OskarStark
Copy link
Contributor

Or @Nyholm can help us here

@nicolas-grekas
Copy link
Member

We provide both implementations 1. and 2.
The correct term is invalidation to me. The doc should be fixed.

@fabpot fabpot modified the milestones: 6.1, 6.2 May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0