Skip to content

[Cache] Show how to configure the cache #11329

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
wants to merge 1 commit into from
Closed

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm 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

@OskarStark OskarStark changed the title [Cache] WIP: Show how to configute the cache [Cache] WIP: Show how to configure the cache Apr 7, 2019
@OskarStark OskarStark added the ⭐️ EU-FOSSA Hackathon https://symfony.com/blog/the-symfony-and-api-platform-hackathon-is-coming label 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
Copy link
Member Author

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

Choose a reason for hiding this comment

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

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

Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

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

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

cache.rst Outdated

.. code-block:: yaml

framework:
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

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)

@Nyholm
Copy link
Member Author

Nyholm commented Apr 7, 2019

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

@Nyholm Nyholm force-pushed the cache branch 2 times, most recently from c3fc724 to f01db6d Compare April 7, 2019 10:10
@Nyholm
Copy link
Member Author

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

Failure is fixed here: #11348

@wouterj
Copy link
Member

wouterj 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 April 7, 2019 19:37
@wouterj wouterj closed this in 7700cab Apr 7, 2019
wouterj added a commit that referenced this pull request Apr 7, 2019
* 4.2:
  [#11329] Readded the Symfony cache contracts example
  [Cache] Show how to configure the cache
@wouterj
Copy link
Member

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

Nyholm commented Apr 7, 2019 via email

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

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

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

clearers (missing s)

@nicolas-grekas
Copy link
Member

I found some typos :)
Thank you writting this!

@Nyholm Nyholm mentioned this pull request Apr 8, 2019
@Nyholm
Copy link
Member Author

Nyholm commented Apr 8, 2019

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

@Nyholm Nyholm deleted the cache branch April 8, 2019 05:41
wouterj added a commit that referenced this pull request Apr 8, 2019
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
Labels
Cache ⭐️ EU-FOSSA Hackathon https://symfony.com/blog/the-symfony-and-api-platform-hackathon-is-coming Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants