Skip to content

Add Redis and Memcached support - #2554

Merged
wojtekn merged 19 commits into
trunkfrom
wojtekn/add/redis-memcached-support
Feb 23, 2026
Merged

Add Redis and Memcached support#2554
wojtekn merged 19 commits into
trunkfrom
wojtekn/add/redis-memcached-support

Conversation

@wojtekn

@wojtekn wojtekn commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Related issues

Fixes STU-1178

Proposed Changes

I propose to enable Redis and Memcached PHP extensions for all Studio sites.

Testing Instructions

Confirm:

  • Sites can be created, started, stopped, deleted
  • Redis and Memcached are now available to WordPress installations on Studio sites without UI changes.
  • Studio CLI works

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@wojtekn wojtekn changed the title Add Redis and Memcached support for all Studio sites Feb 9, 2026
@wojtekn wojtekn self-assigned this Feb 9, 2026
@wojtekn
wojtekn requested review from a team and adamziel February 9, 2026 10:07
@wojtekn
wojtekn force-pushed the wojtekn/add/redis-memcached-support branch from 2682186 to fc8c5bf Compare February 9, 2026 10:54
@wpmobilebot

wpmobilebot commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 5d4b955 vs trunk

site-editor

Metric trunk 5d4b955 Diff Change
load 1436.00 ms 1475.00 ms +39.00 ms ⚪ 0.0%

site-startup

Metric trunk 5d4b955 Diff Change
siteCreation 7121.00 ms 7150.00 ms +29.00 ms ⚪ 0.0%
siteStartup 3945.00 ms 3958.00 ms +13.00 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@wojtekn
wojtekn changed the base branch from trunk to wojtekn/add/jspi-support February 10, 2026 13:09
@wojtekn wojtekn changed the title Enable JSPI and add Redis and Memcached support Feb 10, 2026
@wojtekn
wojtekn force-pushed the wojtekn/add/redis-memcached-support branch 2 times, most recently from 1e061b2 to cf0b171 Compare February 10, 2026 13:14
@wojtekn
wojtekn force-pushed the wojtekn/add/jspi-support branch from 247fa61 to b1bade5 Compare February 10, 2026 13:18
@wojtekn
wojtekn force-pushed the wojtekn/add/redis-memcached-support branch 2 times, most recently from d205798 to afc385b Compare February 10, 2026 13:19
@wojtekn
wojtekn force-pushed the wojtekn/add/jspi-support branch from b1bade5 to 029766e Compare February 10, 2026 14:02
@wojtekn
wojtekn force-pushed the wojtekn/add/redis-memcached-support branch from afc385b to 38c814f Compare February 10, 2026 14:04

@ivan-ottinger ivan-ottinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All site operations still work well. I did not observe any issues with the CLI.

Regarding the reported slowdown of the site creation (+1010.00 ms | 🔴 14.2%), I run the performance test locally (3 rounds) and here are the results:

  site-editor
  ┌────────┬─────────┬─────────┬───────────────┐
  │ Metric │  trunk  │ branch  │     Diff      │
  ├────────┼─────────┼─────────┼───────────────┤
  │ load   │ 2918 ms │ 1446 ms │ -50.4% faster │
  └────────┴─────────┴─────────┴───────────────┘
  site-startup
  ┌──────────────┬─────────┬─────────┬─────────────┐
  │    Metric    │  trunk  │ branch  │    Diff     │
  ├──────────────┼─────────┼─────────┼─────────────┤
  │ siteCreation │ 7044 ms │ 7047 ms │ +3 ms (~0%) │
  ├──────────────┼─────────┼─────────┼─────────────┤
  │ siteStartup  │ 3908 ms │ 3910 ms │ +2 ms (~0%) │
  └──────────────┴─────────┴─────────┴─────────────┘

So in that front it is looking good as well. 🙂

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me, and Sites start correctly, and I didn’t notice any performance degradation., although I’m not sure how to use Redis in my Studio sites. When installing https://wordpress.org/plugins/redis-cache/, I see the same error message as in trunk Redis is unreachable: Error while reading line from the server. [tcp://127.0.0.1:6379].

Same overview results for trunk and this branch:

Image

The plugin diagnostics show the PhpRedis is installed for this PR:

Image

Before / After Diff

Status: Not enabled
Client: 
Drop-in: Not installed
Disabled: No
-PhpRedis: Not loaded
+PhpRedis: 6.3.0
Relay: Not loaded
Predis: 2.4.0
Credis: Not loaded
PHP Version: 8.3.30
Plugin Version: 2.7.0
Redis Version: Unknown
Multisite: No
Metrics: Disabled
Metrics recorded: 0
Filesystem: Writable
WP_REDIS_PLUGIN_PATH: "/wordpress/wp-content/plugins/redis-cache"
Drop-ins: [
    "SQLite integration (Drop-in) v1.0.0 by WordPress Performance Team"
]
Comment thread package-lock.json
},
"node_modules/fs-xattr": {
"version": "0.3.1",
"hasInstallScript": true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an unrelated change 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, removed.

@fredrikekelund

Copy link
Copy Markdown
Contributor

Redis and Memcached are now available to WordPress installations on Studio sites without UI changes

@wojtekn, how do we actually test this?

@wojtekn

wojtekn commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

@wojtekn, how do we actually test this?

I dumped phpinfo() in the wp-config.php and confirmed the extension data is there, but based on @sejas comment shared above, it seems we need to check it it really works.

@wojtekn
wojtekn marked this pull request as draft February 13, 2026 08:30
Base automatically changed from wojtekn/add/jspi-support to trunk February 20, 2026 13:30
Keep Redis/Memcached and JSPI changes from branch; take trunk versions
of package.json and package-lock.json, and accept deletion of cli/package.json,
cli/package-lock.json, and vite.cli.config.ts which moved in the monorepo.
@wojtekn
wojtekn marked this pull request as ready for review February 20, 2026 14:39
@wojtekn

wojtekn commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

@sejas @fredrikekelund I tested Redis and confirmed it works fine:

  1. Start Redis server using Docker
docker run --name studio-redis -p 6379:6379 -d redis                                                                                          
  1. Start Studio from this PR
  2. Create a new site
  3. Open WP Admin and install "Redis Object Cache" plugin
  4. Configure Redis server address in wp-config.php file:
define( 'WP_REDIS_HOST', '127.0.0.1' );
define( 'WP_REDIS_PORT', 6379 );
  1. Enable Redis as object cache in WP Admin

I see the following in backend:

CleanShot 2026-02-23 at 09 42 34@2x

And CLI:

% studio wp redis status
Status: Connected
Client: PhpRedis (v6.3.0)
[...]

I see the cache data in redis-cli, too:

% redis-cli
127.0.0.1:6379> KEYS *
 1) "wp:site-transient:theme_roots"
 2) "wp:terms:last_changed"
[...]

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wojtekn, thanks for expanding on the testing steps. I can confirm that I was able to start a Redis server in Docker using docker run -d --name redis -p 6379:6379 redis:latest, and my Studio site successfully connected to it.

Image Image Image

One last observation is that we’re enabling Redis and Memcached for all sites, even though most of them won’t use them. I didn’t observe any performance impact during my testing, but it’s something to keep in mind.

@wojtekn

wojtekn commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

One last observation is that we’re enabling Redis and Memcached for all sites, even though most of them won’t use them. I didn’t observe any performance impact during my testing, but it’s something to keep in mind.

Yes, performance metrics don't show any decrease.

@wojtekn
wojtekn merged commit 1af51ee into trunk Feb 23, 2026
9 checks passed
@wojtekn
wojtekn deleted the wojtekn/add/redis-memcached-support branch February 23, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants