Problem/Motivation

I wanted to update https://www.drupal.org/node/1884814, but couldn't because it's not at all clear why #2231595: Add a cache backend that checks an inconsistent cache, then falls back to a consistent cache backend didn't use BackendChain (it's not documented in the code, nor explained in the issue, despite having been asked twice).

Or perhaps it makes more sense to remove BackendChain?

Currently, both seem to solve the same problem. That's bad. Let's fix that.

Proposed resolution

Remaining tasks

User interface changes

None.

API changes

TBD

Data model changes

None.

CommentFileSizeAuthor
#4 2541432-3.patch2.07 KBwim leers
#2 2541432-2.patch2.07 KBwim leers

Comments

wim leers’s picture

Title: Follow-up for #2231595: Either remove BackendChain or document why ChainedFastBackend cannot use BackendChain » Follow-up for #2231595: Document why ChainedFastBackend cannot use BackendChain

catch confirmed in IRC the reason is what I wrote at #2231595-8: Add a cache backend that checks an inconsistent cache, then falls back to a consistent cache backend.4:

+++ b/core/lib/Drupal/Core/Cache/CacheFactory.php
--- /dev/null
+++ b/core/lib/Drupal/Core/Cache/ChainedConsistentAndInconsistentBackend.php

Why doesn't this subclass \Drupal\Core\Cache\BackendChain? I think it's because BackendChain "stupidly" chains cache back-ends, not allowing for inconsistent cache back-ends, only allowing for consistent-but-automatically-discarding-cache-entries cache back-ends (i.e. LRU/MRU/…)?

If so, it'd be great if this were documented on ChainedConsistentAndInconsistentBackend.

wim leers’s picture

Status: Active » Needs review
Issue tags: +Documentation
StatusFileSize
new2.07 KB
dawehner’s picture

Can we rename the classes to be more helpful?

wim leers’s picture

StatusFileSize
new2.07 KB

s/back-end/backend/

wim leers’s picture

@dawehner Yes, but that's more bikesheddable + a lot more work invasive, and we need these docs anyway, so I'd prefer renaming in another issue.

fabianx’s picture

Status: Needs review » Reviewed & tested by the community

RTBC, looks good to me.

wim leers’s picture

Priority: Major » Normal
dawehner’s picture

So what about creating an issue to actually improve the naming? A proper naming is much more worth than some docs.

Anonymous’s picture

+1 to the doc additions.

re. #8 - i'd be happy to figure out a better name. i seem to recall it was not fun to name the first time around.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Docs are unfrozen in beta. Committed 74c4534 and pushed to 8.0.x. Thanks!

  • alexpott committed 74c4534 on 8.0.x
    Issue #2541432 by Wim Leers: Follow-up for #2231595: Document why...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.