Problem/Motivation

#3278493: Make it easier for theme builders to enable Twig debugging and disable render cache adds a new UI for enabling development settings.

However, in comment #120, @crasx pointed out a weird behavior: if you have the cache enabled, you disable it and make changes, and enable it again, you get the old cached markup. This is odd and not expected, so a bad and confusing DX experience.

Steps to reproduce

  • Visit homepage with caching fully enabled (ie: nothing checked) - warms cache
  • Visit /admin/config/development/settings Check the do not cache markup checkbox / save
  • Update a twig template used on the homepage (I updated core/themes/olivero/templates/layout/html.html.twig)
  • View homepage, confirm new change appears with no cache clear
  • Visit /admin/config/development/settings Uncheck the do not cache markup checkbox / save
  • View homepage, note old cached version before the change appears

Proposed resolution

When enabling cache again, you should get the latest markup.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3359931

Command icon 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

ckrina created an issue. See original summary.

mglaman’s picture

We need to make sure Twig cache and those cache bins are dumped when those settings are turned off

mglaman’s picture

Assigned: Unassigned » mglaman

Working on a patch quickly

mglaman’s picture

Assigned: mglaman » Unassigned
Status: Active » Needs review
Issue tags: +Needs tests

Needs review! But also needs tests.

smustgrave’s picture

Status: Needs review » Postponed
Issue tags: +Needs Review Queue Initiative

Just going through the queue

This seems to be postponed on https://github.com/mglaman/phpstan-drupal/issues/563

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.