You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Your Name 4a61cc237e
debug command
2 years ago
.gitignore Add some basic prints 2 years ago
README.md first commit 2 years ago
go.mod fix import path 2 years ago
go.sum first commit 2 years ago
main.go debug command 2 years ago

README.md

#wp-metacache

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.