Problem/Motivation
While investigating (Drupal 10.3) if we should enable the new State_cache see https://metadrop.net/en/articles/what-you-need-know-enabling-state-cache-drupal-103 this module seems to be the largest in our state cache. I see this issue https://www.drupal.org/project/paragraphs_report/issues/3423079 recently moved from config to state. But the article I linked to suggests to replace the state API with the key_value one.

Steps to reproduce
On a large site run the sql commands from https://metadrop.net/en/articles/what-you-need-know-enabling-state-cache... and see size of state api.
This module was the biggest offender.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| 2025-01-31_07-06-31.jpg | 31.67 KB | nicholass |
Issue fork paragraphs_report-3503579
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
Comment #2
astonvictor commentedFYI an example of key_value:
$keyvalue = \Drupal::keyValue('my_collection');
$keyvalue->set('token', '12345');
$value = $keyvalue->get('token');
Comment #3
astonvictor commentedComment #5
astonvictor commentedshould work ok now
also implemented an update hook to move data from the state to key-value.
Comment #7
astonvictor commented