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

[Cache] Show how to configure the cache #11329

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
5 participants
@Nyholm
Copy link
Member

commented Apr 6, 2019

This will fix #10989, fix #8711 and resolve many of my previous headaches.

I want to have a page that explain how you configure the cache with the framework bundle. I added a first draft, some things are just notes to myself.

This is clearly a work in progress, I will continue on this tomorrow.

#eu-fossa

Show resolved Hide resolved cache.rst Outdated

@OskarStark OskarStark changed the title [Cache] WIP: Show how to configute the cache [Cache] WIP: Show how to configure the cache Apr 7, 2019

@Nyholm Nyholm changed the title [Cache] WIP: Show how to configure the cache [Cache] Show how to configure the cache Apr 7, 2019

@Nyholm

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2019

Ping @wouterj, Im ready for a review.

cache.rst Outdated
component is shipped with many adapters to different storages. Every adapter is
developed for high performance.

Basic uses of the cache looks like this.

This comment has been minimized.

Copy link
@OskarStark

OskarStark Apr 7, 2019

Contributor

Please use „::“ sth the end instead of the next code block directive

@wouterj
Copy link
Member

left a comment

Looks really great! Added some small comments, but this article will be a huge help for people wanting to use caching I think.

Show resolved Hide resolved cache.rst Outdated
Show resolved Hide resolved cache.rst Outdated
cache.rst Outdated

.. code-block:: yaml
framework:

This comment has been minimized.

Copy link
@wouterj

wouterj Apr 7, 2019

Member

Please prefix a comment indicating the file name: # config/packages/cache.yaml (not sure if this path is correct)

This comment has been minimized.

Copy link
@wouterj

wouterj Apr 7, 2019

Member

And in the final version of this PR, we also should add the XML and PHP examples (we can help you write them)

cache.rst Outdated
- cache.adapter.psr6
- cache.adapter.system
- NullAdapter
- cache.adapter.array

This comment has been minimized.

Copy link
@wouterj

wouterj Apr 7, 2019

Member

We always use the * sign for lists instead of the dash.

And maybe it's usefull to group this list? For instance, we have "decorator" adapters (like Chain and PSR6 IIRC), actual implementation (almost all others) and test adapters (Null & array)

Show resolved Hide resolved cache.rst Outdated
Show resolved Hide resolved cache.rst Outdated
Show resolved Hide resolved cache.rst Outdated
Show resolved Hide resolved cache.rst Outdated
@Nyholm

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2019

Thank you for the review, I've updated the PR accordingly.

@Nyholm Nyholm force-pushed the Nyholm:cache branch 2 times, most recently from c3fc724 to f01db6d Apr 7, 2019

Show resolved Hide resolved cache.rst Outdated
@wouterj

wouterj approved these changes Apr 7, 2019

@Nyholm

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2019

The build failure seams unrelated.

This could be merged in 3.4. But then we should probably remove the intro section about CacheInterface from Contracts.

Tell me if I can do anything more to make sure this is merged.

@OskarStark

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2019

Failure is fixed here: #11348

@wouterj

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

No worries, this is one of the greatest additions of the weekend, so I'm going to merge it when I'm back home.

I think for 3.4, we can change the example to PSR-6 and then use your contract example as of 4.2?

@wouterj wouterj changed the base branch from master to 3.4 Apr 7, 2019

@wouterj wouterj force-pushed the Nyholm:cache branch from 0710ecf to 957fbab Apr 7, 2019

wouterj added a commit that referenced this pull request Apr 7, 2019

@wouterj wouterj closed this in 7700cab Apr 7, 2019

wouterj added a commit that referenced this pull request Apr 7, 2019

Merge branch '4.2'
* 4.2:
  [#11329] Readded the Symfony cache contracts example
  [Cache] Show how to configure the cache
@wouterj

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

Thanks a lot for your effort into creating this documentation! It has been missing for way too long.

I've merged this into 3.4 and changed the example to be PSR-16 (because, tbh, PSR-6 felt too complex for a "hey look how great our component is" example). And then reintroduced the code example in this PR in e5c28d7 on the 4.2 branch.

@javiereguiluz can you make sure https://symfony.com/doc/current/index.html gets updated with this new "Cache" main guide?

@Nyholm

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2019

Configuring Cache with FrameworkBundle
--------------------------------------

When configuring the the cache component there are a few concepts you should know

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Apr 7, 2019

Member

double "the"

------------------

To clear the cache you can use the ``bin/console cache:pool:clear [pool]`` command.
That will remove all the entries from your storage and you wil have to recalcuate

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Apr 7, 2019

Member

typo: recalculate

To clear the cache you can use the ``bin/console cache:pool:clear [pool]`` command.
That will remove all the entries from your storage and you wil have to recalcuate
all values. You can also group your pools into "cache clearers". There are 3 cache
clearer by default:

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Apr 7, 2019

Member

clearers (missing s)

@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Apr 7, 2019

I found some typos :)
Thank you writting this!

@Nyholm Nyholm referenced this pull request Apr 8, 2019

Merged

[Cache] Fixed typos #11351

@Nyholm

This comment has been minimized.

Copy link
Member Author

commented Apr 8, 2019

Thank you for the review. Your comments are addressed here: #11351

@Nyholm Nyholm deleted the Nyholm:cache branch Apr 8, 2019

wouterj added a commit that referenced this pull request Apr 8, 2019

minor #11351 [Cache] Fixed typos (Nyholm)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Fixed typos

Fixed typos from #11329

Commits
-------

540c62d [Cache] Fixed typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.