Automattic / Automattic/jetpack
Boost: add rudimentary plugin system to cache system
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
We should allow sites to customize or interact with the caching process when pages are served, but that code loads before most of WordPress. This code can still use actions and filters, since they are loaded very early. As part of a separate PR, we should add more filters and hooks to the caching system.
We will need to load this code and execute it when advanced-cache.php loads.
The loader will check for the existence of a particular file and load that, executing it as a PHP script. By default, that should be wp-content/boost-cache/extend.php
Since the wp-content/boost-cache/ directory is made by the web server, the site owner may not have write access to it, so we should first check for a constant that points at where the file should be. That constant can be defined in wp-config.php, which again might not be writable, but it's one modification vs many modifications to a file in a read-only directory.
I'll leave it up to the implementation to decide on what constant to use.
Contributor guide
Research direction
Start by tracing how advanced-cache.php loads and how wp-config.php can define configuration. Define the configurable extension-file location, defaulting to wp-content/boost-cache/extend.php, and verify that the loader checks for and executes the file before normal WordPress loading. Additional caching hooks are described as a separate PR, so keep them out of this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100