Allow client-side caching to be disabled while developing

Created on 18 December 2014, almost 11 years ago
Updated 22 August 2025, about 1 month ago

Problem/Motivation

While you are developing a custom module, and integrating with anything client cached, you won't find your new elements (e.g. Contextual links). As a developer, your first thought would be "clear Drupal cache", but that won't solve it. Even knowing the excellent client-side caching solution in D8, I lost some time debugging while trying to integrate a custom module with Contextual Links (i.e. the new contextual links weren't showing up).

In the case of contextual links, window.sessionStorage is used, which means that opening a new tab is enough to get rid of the client-side cache. But this won't be obvious for a D8 newcomer.

Client-side caching works as designed, but there is no way of disabling it while in development. There should be, to have a better DX.

Proposed resolution

Introducing a drupalSettings.disableClientSideCaching boolean flag, that can be enabled from settings.local.php (setting) /development.services.yml (container parameter). Any Drupal module doing client-side caching could then opt in to check whether that value exists and if it's set to TRUE, it would disable all client-side caching.

Remaining tasks

Discuss possible solutions.
Patch.
Review.
Commit.

User interface changes

None.

API changes

None.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

javascript

Created by

πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
  • 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

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!

Production build 0.71.5 2024