manifest / performance / tiny-cache
Tiny cache (MU)
🚄 Cache WordPress post content, template part, translations and nav menu output in persistent object cache
by szepeviktor · github.com/szepeviktor/tiny-cache · website
★ 27stars
4forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/szepeviktor/tiny-cache/archive/refs/heads/master.zipFrom the readme
Tiny cache
Cache post content, translations and nav menu output in persistent object cache.
This MU plugin works well in production providing you understand its source code (133 sloc).
WordPress performance
Please see https://github.com/szepeviktor/wordpress-website-lifecycle/blob/master/WordPress-performance.md
Usage
Of course you need persistent object cache. Consider Redis server and wp-redis plugin.
Replace thecontent() calls in your theme.
NOTICE Replace only argument-less calls! $morelinktext and $stripteaser are not supported.
No-cache situations
- wpsuspendcacheaddition( true );
- define( 'DONOTCACHEPAGE', true );
Prevent missing plugin
Protection against plugin deactivation.
Copy these to your theme's functions.php.
Little sisters
1. Tiny navigation menu cache - for nav menu output
1. Tiny translation cache - for translations (.mo files)
Alternative
https://github.com/Rarst/fragment-cache