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.