Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Conversation

@nicolas-grekas
Copy link
Member

No description provided.

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedAug 7, 2016
edited
Loading

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...

ogizanagi reacted with laugh emoji

- expiration based invalidation for time related dependencies.

.. versionadded:: 3.2
Tags and namespace based invalidation were introduced in Symfony 3.2.
Copy link
Member

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.

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
Copy link
Member

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
Copy link
Member

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
Copy link
Contributor

Koc commentedAug 7, 2016

How to configure tag aware cache using framework config?

@nicolas-grekas
Copy link
MemberAuthor

@Koc I don't know yet :) would need a PR on FrameworkBundle.

nicolas-grekas added a commit to symfony/symfony that referenced this pull requestAug 7, 2016
…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)
@nicolas-grekasnicolas-grekasforce-pushed thecache-invalidation branch 2 times, most recently fromd30112d tof753506CompareAugust 8, 2016 19:22
// 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
Copy link
Contributor

@mickaelandrieumickaelandrieuAug 9, 2016
edited
Loading

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 ?

wouterj and tgalopin reacted with thumbs up emoji
@mickaelandrieu
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

dependent

@nicolas-grekas
Copy link
MemberAuthor

Comments addressed, examples updated. More comments welcomed :)

``Vary: User-Agent`` or ``Vary: Accept-Encoding`` HTTP headers::

$perUserAgentCache = $httpCache->fork($varyingUserAgent);
$perAcceptEndoginPerUserAgentCache = $childCache->fork($varyingAcceptEncoding);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Encoding

fabpot added a commit to symfony/symfony that referenced this pull requestAug 19, 2016
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
symfony-splitter pushed a commit to symfony/cache that referenced this pull requestAug 19, 2016
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
Copy link
Member

Maybe it is just me but I am not quite understanding the "Namespaces"/"Forkable" feature. Perhaps a more extensive example?

@nicolas-grekas
Copy link
MemberAuthor

@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. ? :)
This is hierarchical invalidation done from theoutside, (theinside being prefixing keys explicitly e.g.->getItem('foo/bar'))

@nicolas-grekasnicolas-grekas changed the title[Cache] Add chapter about invalidation, tags, etc.[Cache] Doc forkable adapters, aka namespace based invalidationSep 2, 2016
* Expiration based invalidation for time related dependencies.

.. versionadded:: 3.2
Tags and namespace based invalidation was introduced in Symfony 3.2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

were introduced

@nicolas-grekas
Copy link
MemberAuthor

I just rewrote entirely this paragraph, any better?

@Koc
Copy link
Contributor

Koc commentedSep 16, 2016

Much better now for me

@nicolas-grekasnicolas-grekas changed the title[Cache] Doc forkable adapters, aka namespace based invalidation[Cache] Doc context aware adapters, aka hierarchical invalidationSep 16, 2016
@kbond
Copy link
Member

I'm understanding it much better as well. The example is great!

@nicolas-grekas
Copy link
MemberAuthor

Closing, seesymfony/symfony#19521 (comment)

@nicolas-grekasnicolas-grekas deleted the cache-invalidation branchSeptember 23, 2016 18:51
wouterj added a commit that referenced this pull requestOct 20, 2016
…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.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

10 participants

@nicolas-grekas@wouterj@Koc@mickaelandrieu@kbond@fabpot@sstok@tgalopin@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp