Go to file
Your Name 4a61cc237e debug command 2021-08-17 08:42:25 -04:00
.gitignore Add some basic prints 2021-08-16 18:00:04 -04:00
README.md first commit 2021-08-16 17:35:03 -04:00
go.mod fix import path 2021-08-16 17:41:52 -04:00
go.sum first commit 2021-08-16 17:35:03 -04:00
main.go debug command 2021-08-17 08:42:25 -04:00



This is a combination wordpress plugin and Go service that replaces Wordpress' built in object metadata handling.

Wordpress has two types of object, posts and users. Both have metadata tables and are accessed through the same mechanisms.

Wordpress uses a greedy load system where loading a single metadata attribute will actually load all metadata for that object, and cache the other entries for the life of the request. This more or less works well on small sites where there may be a few or a dozen metadata attributes, but doesn't scale well as those numbers increase. At the same time, the lifespan of that cache is a single request.

This software uses Wordpress hooks to handle those metadata requests via an external Go process. In Go we implement a LRU cache to greedily load metadata but return it a single item at a time. The Go process will retain the data until we reach a configured max capacity, at which point the longest unused entry will be removed. We also hook into Wordpress metadata update and delete routines to explicitly remove entries when stale.

Communication with the Go process is via a Unix socket.