(#4870) Remove deprecated CacheDecoratorInterface from AppPathManager#5302
(#4870) Remove deprecated CacheDecoratorInterface from AppPathManager#5302ChadChandlerPS wants to merge 1 commit into
Conversation
|
Testing Done on this PR
|
CacheDecoratorInterface is deprecated as of Drupal 10.2.0 and removed in Drupal 11.0.0 with no replacement (see https://www.drupal.org/node/3398182). AppPathManager implemented it solely to satisfy the interface's setCacheKey()/writeCache() method signatures; neither method is invoked anywhere in the codebase, so dropping the interface has no behavioral effect. Updated the now orphaned @inheritdoc docblocks on those two methods to describe them directly. Closes #4870
e05eb81 to
b75136b
Compare
|
@ChadChandlerPS - what do you mean by the following:
|
|
While working this, I traced every caller of these caching-related methods across Finding
Every request that reaches this service just does a plain DB query via
This whole thing predates this ticket and removing the deprecated interface has no effect since these methods were already unreachable. |
@bryanpizzillo To clarify - After digging into this more one correction to my earlier note: I said |
|
Well I will agree that the CacheDecoratorInterface is dead. It was only even "used" in Drupal for the AliasManager and when Aliases became entities things all changed. Technically the interface was never used at all - nowhere in the code did something expect a CDI to be passed in. The only thing that used the methods defined by the CDI was PathSubscriber and that expected a AliasManagerInterface, not a CacheDecoratorInterface... Now, here is the interesting thing, the PathSubscriber code loaded all aliases onKernelController and then wrote the cache onKernelTerminate. Subsequent requests would read from the cache. Technically they cached each individual route, where our code would store all. Writing the cache on termination was weird, but I guess if someone fiddled with the aliases during the session then... What I cannot see is where we ever actually did the writeCache. I am not talking about the current code, but from early days when it was first created. (10/2019) So the flow of our code is something like the following. It should be noted that we have a EventSubscriber that subscribes to the onKernelRequest event, so that we end up coming before RouteNormalizerRequestSubscriber. Our path processors run before our method onKernelRequest. (I would imagine that the core figuring out the route has a really high priority) flowchart LR
b["RouteProvider::getRouteCollectionForRequest"]
c["PathProcessorManager::processInbound"]
d["PathProcessorAppModule::processInbound"]
e["AppPathManager::getPathByRequest"]
f["AppPathManager::initPathData"]
g[("DataCache")]
b --> c
c --> d
d --> e
e --> f
f --> g
This kind of mirrors the AliasManager. (This code was all lifted from the AliasManager) The reason we would want caching is the same reason Drupal did with AliasManager - you don't want to hit the DB for every request. I did check the DB on an ODE and nothing is in the cache_data table, so yeah, as the code says, we are not caching anywhere. So it is kind of an issue that we are skipping the cache, and have been. This could be confirmed by setting a breakpoint in the So I think we are ok to merge this PR, but we need to make a ticket to fix the not caching. I bet it would speed up requests, especially after cache clears. |
Agreed @bryanpizzillo . Suggest maybe wiring it up with a |
ODE DeploymentCode has been deployed to ODE 1153. |
CacheDecoratorInterface is deprecated as of Drupal 10.2.0 and removed in Drupal 11.0.0 with no replacement (see
https://www.drupal.org/node/3398182).
Updated the now orphaned
@inheritdocdocblocks to describe them directly.Closes #4870