brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: WP_CACHE true makes wordpress load wp-content/advanced-cache.php early

WordPress
~/tips/tip-wordpress-wp-cache-constant-advanced-cache

define( 'WP_CACHE', true );

Enables the advanced-cache drop-in that page caching plugins use to answer requests before WordPress loads.

Page cache plugins add one line to wp-config.php, and it is good to know what it does.

define( 'WP_CACHE', true );

With this constant set, WordPress includes wp-content/advanced-cache.php very early in the load, before most of the core and the plugins. A page caching plugin uses that drop-in to serve a stored page and stop the rest of the request. If the constant is true but the file is missing, nothing breaks, it just does nothing. After you remove a caching plugin, also remove the constant and the leftover drop-in, otherwise a stale file can keep serving old pages.

Further reading: WordPress: Editing wp-config.php

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link