-
-
Notifications
You must be signed in to change notification settings - Fork 137
feat(cache): separate internal and user caches #1245
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
Conversation
|
This all makes sense. I think it's better to merge before 1.0 though, because I believe it's technically a breaking change? One remark
Shouldn't view cache be enabled by default as well? I still need to go through the code, but let's first hear your thoughts on merging it early? |
I'm not sure, I think it was not enabled by default before. I haven't really taken a look at how it works exactly, but if you think it should be, we can change that
Totally fine by me (I would even prefer that)—but I don't mind if you prefer merging later |
I'm not sure either anymore, let's make a note to double check before merging
Let's merge before beta (but after the ORM refactor so that I can review the code as well) |
I'm confident it wasn't enabled before! I just don't know if that was intended or not. |
|
Then it's fine! I'll review today :) |
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.
Most of my remarks aren't real blockers, I think I rather just wanted to better understand your reasoning behind some features.
It's a great PR, looking forward to hearing your thoughts on those comments, and then merging before beta.2.
Apart from the cache interface changes, what kind of things will break for users because of this? For example: we merge this, what should be changed on tempest-docs production to make sure caching still works the way it's supposed to work?
Only the |
|
@innocenzi I'm fine merging this, just wanted to double-check with you if that's ok? |
|
@brendt Yes, let's go! I'm fixing the failures that are due to the merge of |
This pull request is a complete overhaul of the cache component. The main purpose behind it is to have a similar implementation to the database and storage components in regards to the configuration. The internal caches (config, view, icon) are now completely separate caches with their own implementations.
Summary of changes
tempest/cachetempest aboutinsightsComparison between previous and new API
Previously, configuring the user cache required instantiating one of Symfony's adapter in the
CacheConfigobject:Now, you may use one of the provided config objects:
And of course, it's now possible to add multiple caches by adding a tag to one of the config objects:
The
cache:clearandcache:statuscommands now separate user and internal caches. By default,cache:clearclears the default user cache. If more caches were created, you may select which ones to clear.Environment variables
Last but not least, the way caches are enabled or disabled have been simplified. Instead of having to have a
CACHE,PROJECT_CACHE,ICON_CACHE,VIEW_CACHE,CONFIG_CACHE, andDISCOVERY_CACHEin.env, caches are disabled by default in a local environment, and enabled in production (except for the icon cache, which is always enabled by default).Of course, they can still be disabled with those environment variables, but they are optional. However, the
CACHEenvironment variable has been renamed toINTERNAL_CACHESfor clarity.In short, here are the new environment variables (all optional):