Metatag Views integrations contains Views cache plugin wrapper to defer cache set for view results.
As it is implementing is's own logic how to set/get cache and it overrides cache logic defined by original cache plugin.
One example is Search API cache plugin.
It has CacheSet to store original results retrieved from cache backend server and CacheGet to trick that search was performed and need data is set https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Plugin/...
Metatag's cache wrapper decorates that plugin and overrides entire cache set/get https://git.drupalcode.org/project/metatag/-/blob/8.x-1.x/metatag_views/... with it's own login and the original login is no longer used and destroys plugins logic.
This causes issue that #3258080: Facets disappear on refresh because cached view does not populate data correctly after cache get (as correct cache was not set at all)
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | metatag-n3261473-16.patch | 6.14 KB | damienmckenna |
| #16 | metatag-n3261473-16.interdiff.txt | 1.26 KB | damienmckenna |
| #15 | metatag-n3261473-15.patch | 5.25 KB | damienmckenna |
| #12 | metatag-n3261473-12.patch | 5.96 KB | damienmckenna |
Issue fork metatag-3261473
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
damienmckennaSee also: #3245876: Out of memory error with metatag_view submodule and Search API view
Comment #3
eugene bocharov commentedI agree, MetatagViewsCacheWrapper is added as decorator, but it doesn't pass through the cacheSet/cacheGet calls to the decorated cache plugin for views result. This can and boviously do cause the problems with caching.
Maybe we should use some another approach to store the first row tokens cache, saving it in separate cache, for example.
Just for reference, MetatagViewsCacheWrapper was intoduced in https://www.drupal.org/project/metatag/issues/2952229
Comment #6
socialnicheguru commentedComment #7
elioshAny news on this issue?
Comment #8
damienmckennaThe merge request needs further work.
Comment #9
b_sharpe commentedMR needs a rebase, I took a look but unsure as to exactly what it's doing... it removes the decorator but then edits the wrapper so I'm unsure if I'm missing something here?
Comment #11
claudiu.cristeaRebased and works as expected
Comment #12
damienmckennaHow would we test this?
Here's the latest merge request in patch format.
Comment #13
hitchshock+1 RTBC. The patch fixed the issue for me.
But I agree with @damienmckenna, it's an interesting question about how to test it.
Comment #14
heddnThis fixed the issue with memory. Had a large site with redis, views and metatag_views and this caused us quite an issue for a while. Applying the patch fixes that.
Comment #15
damienmckennaRerolled.
Comment #16
damienmckennaMissed a bit.
Comment #17
heddnLooks good by me.
Comment #19
damienmckennaThanks heddn! Committed. Thanks everyone!