Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Cache] Doc context aware adapters, aka hierarchical invalidation#6858
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cd6020f to95e7978Comparenicolas-grekas commentedAug 7, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'd happily accept any suggestions for making the explanations more detailed. It's hard to write doc when things seem obvious because you wrote the code... |
| - expiration based invalidation for time related dependencies. | ||
| .. versionadded:: 3.2 | ||
| Tags and namespace based invalidation were introduced in Symfony 3.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I believe it should be "was" here, as it's refering to "X based invalidation", which is singular.
95e7978 tobb34f3cCompare| invalidation version number (conceptually similar to their latest invalidation | ||
| date). When only one adapter is used, items and tags are all stored in the same | ||
| place. By using two adapters, you can e.g. store some big cached items on the | ||
| filesystem or in the database, and keep tags in a Redis database to sync all your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
please remove the serial comma before "and keep"
wouterj commentedAug 7, 2016
Sorry, was distracted for some time during the review of this PR. I've now finished reviewing this article, thanks for documenting this feature! status: needs work |
Koc commentedAug 7, 2016
How to configure tag aware cache using framework config? |
nicolas-grekas commentedAug 7, 2016
@Koc I don't know yet :) would need a PR on FrameworkBundle. |
…TagAwareRedisAdapter) (nicolas-grekas)This PR was merged into the 3.2-dev branch.Discussion----------[Cache] Add generic TagAwareAdapter wrapper (replaces TagAwareRedisAdapter)| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR |symfony/symfony-docs#6858This PR replaces TagAwareRedisAdapter introduced in#19047 by a generic `TagAwareAdapter` that works with any two adapters.Commits-------288308b [Cache] Add generic TagAwareAdapter wrapper (replaces TagAwareRedisAdapter)
d30112d tof753506Compare| // or invalidate all items related to `tag_1` or `tag_3` | ||
| $cache->invalidateTags(array('tag_1', 'tag_3')); | ||
| Of course when you know the cache key, it's better to call |
mickaelandrieuAug 9, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would reword that this way:
Using Cache tags invalidation is very useful when you don't need to know the cache key to delete.
And I will mention$cache->deleteItem('cache_key'); in the previous example (self-explained).
WDYT ?
mickaelandrieu commentedAug 9, 2016
The docs is clear to me (non-native english). Big thanks to you@nicolas-grekas ! I want to play with this component now ^^ |
| The Symfony Cache component provides three mechanisms to help solve this problem: | ||
| * Tags based invalidation for managing data dependencies; | ||
| * Namespace based invalidation for context dependend data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
dependent
f753506 to7fa65acComparenicolas-grekas commentedAug 19, 2016
Comments addressed, examples updated. More comments welcomed :) |
| ``Vary: User-Agent`` or ``Vary: Accept-Encoding`` HTTP headers:: | ||
| $perUserAgentCache = $httpCache->fork($varyingUserAgent); | ||
| $perAcceptEndoginPerUserAgentCache = $childCache->fork($varyingAcceptEncoding); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Encoding
7fa65ac toe5e112fCompareThis PR was merged into the 3.2-dev branch.Discussion----------[Cache] Add PDO + Doctrine DBAL adapter| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR |symfony/symfony-docs#6858This PR adds a PDO adapter for our PSR-6 cache items. The implementation heavily borrows from PdoSessionHandler.Commits-------82a0de2 [Cache] Add PDO + Doctrine DBAL adapter
This PR was merged into the 3.2-dev branch.Discussion----------[Cache] Add PDO + Doctrine DBAL adapter| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR |symfony/symfony-docs#6858This PR adds a PDO adapter for our PSR-6 cache items. The implementation heavily borrows from PdoSessionHandler.Commits-------82a0de2 [Cache] Add PDO + Doctrine DBAL adapter
kbond commentedAug 25, 2016
Maybe it is just me but I am not quite understanding the "Namespaces"/"Forkable" feature. Perhaps a more extensive example? |
nicolas-grekas commentedSep 2, 2016
@kbond seehttps://www.drupal.org/developing/api/8/cache/contexts for another use case of this feat. Maybe one should first read this page then help me find the right words to explain the feat. ? :) |
e5e112f to2c31a64Compare2c31a64 to9f775bbCompare| * Expiration based invalidation for time related dependencies. | ||
| .. versionadded:: 3.2 | ||
| Tags and namespace based invalidation was introduced in Symfony 3.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
were introduced
9f775bb todd864d8Comparenicolas-grekas commentedSep 15, 2016
I just rewrote entirely this paragraph, any better? |
Koc commentedSep 16, 2016
Much better now for me |
kbond commentedSep 16, 2016
I'm understanding it much better as well. The example is great! |
nicolas-grekas commentedSep 23, 2016
Closing, seesymfony/symfony#19521 (comment) |
…olas-grekas)This PR was merged into the master branch.Discussion----------[Cache] Add chapter about invalidation, tags, etc.This is a subpart of#6858 that tells only about merged features. Please merge asap so we can rebase#6858 on top and focus on its specific bits afterwards :)Commits-------0ffc261 [Cache] Add chapter about invalidation, tags, etc.
No description provided.