Avoid global cache clear for node URLs

Created on 28 December 2021, over 3 years ago
Updated 5 February 2025, 2 months ago

Problem/Motivation

This module clears caches with drupal_flush_all_caches every time a protected page is created or updated.
This seems kind of a sledgehammer approach. At least for Node URLs I would propose to use a less invasive way by using CacheTagsInvalidator service.

Steps to reproduce

Add or edit a protected page. Depending on the size of your website you will experience a unusually large time the process takes to save the add or edit and afterwards your whole website maybe slow until caches are filled up again. It may even lead to more serious problems, like timeout or deadlocks in some environments.

Proposed resolution

At least for Node URLs i would propose to use a less invasive way by using CacheTagsInvalidator service.
Maybe this can be implemented for non-Node pages too, but seems a bit more difficult to get all possible kind of paths.

Remaining tasks

create a patch

User interface changes

speed up add/edit for protected node pages and avoid performance penalty

API changes

none

Data model changes

none

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇩🇪Germany stefan.korn Jossgrund

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024