Don't clear the CSS cache when installing themes

Created on 4 December 2013, almost 12 years ago
Updated 22 August 2025, 29 days ago

#2109287: Replace list_themes() with a service. shows that we clear the CSS cache every time we enable a theme.

The cache isn't based on which themes are enabled, so this seems pointless.

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component

theme system

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

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.

  • 🇺🇸United States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • 🇬🇧United Kingdom catch
        $this->cssCollectionOptimizer->deleteAll();
    
    

    This is still in the theme installer.

    Needs the patch converted to an MR, or just a fresh MR created removing that line. Not sure we need tests for this, we'd just be testing that we removed the code really - e.g. we'd need to get some CSS aggregates created on disk, install a theme, make sure they're still there. But also with 📌 Bring back the asset stale file threshold Active new aggregates wouldn't get deleted anyway, making this impossible to test. Given that, removing the needs tests tag.

  • First commit to issue fork.
  • 🇮🇳India neerajsingh IN 🇮🇳

    I will convert the patch to MR.

  • 🇺🇸United States smustgrave

    Just an FYI newly tagged novice tickets are typically meant for newer users to try, that have less then 1 page of posts.

    After a few weeks if no new user doesn't pick it up it's fair game.

  • Pipeline finished with Success
    28 days ago
    Total: 618s
    #579895
  • 🇮🇳India neerajsingh IN 🇮🇳

    Thank you, for highlighting this @smustgrave.

  • 🇺🇸United States smustgrave

    No worries!

    For good practice lets update the summary to use the standard template

  • 🇮🇳India neerajsingh IN 🇮🇳

    Updated issue summary.

Production build 0.71.5 2024