Install NitroPack on Autoscale
NitroPack page caching relies on advanced-cache.php, a WordPress drop-in that must be present in wp-content/ before WordPress loads. On a traditional install, NitroPack writes this file itself. On Autoscale the filesystem is read-only, so you commit the file to your repository as part of the plugin.
This guide walks through that process. You will copy the file from inside the plugin, fill in four values specific to your environment, and deploy. NitroPack version 1.19.9 or later is required.
Prerequisites
Section titled “Prerequisites”- An Autoscale environment with a working Pipelines deployment
- A local clone of your site repository
- Access to the environment’s wp-admin
1. Add NitroPack to your repository
Section titled “1. Add NitroPack to your repository”Version 1.19.9 or later is required.
composer require wpackagist-plugin/nitropackcomposer installCommit the installed files. Do not push yet.
Download version 1.19.9 or later from wordpress.org/plugins/nitropack, unzip the archive, and copy the nitropack directory into plugins/ at the root of your repository. Do not push yet.
2. Copy advanced-cache.php to the repository root
Section titled “2. Copy advanced-cache.php to the repository root”From the root of your repository, run:
cp plugins/nitropack/classes/WordPress/AdvancedCache/advanced-cache.php advanced-cache.phpThis puts the drop-in at the repository root, which the platform maps to wp-content/advanced-cache.php where WordPress looks for it on every request.
3. Fill in the four placeholders
Section titled “3. Fill in the four placeholders”Open advanced-cache.php and replace each placeholder string exactly as shown.
a. /*NITROPACK_FUNCTIONS_FILE*/
Section titled “a. /*NITROPACK_FUNCTIONS_FILE*/”Replace with the absolute path to NitroPack’s functions file on the platform:
/var/www/html/wp-content/plugins/nitropack/functions.phpb. /*NITROPACK_ABSPATH*/
Section titled “b. /*NITROPACK_ABSPATH*/”Replace with the WordPress root path on the platform:
/var/www/html/c. /*NP_VERSION*/
Section titled “c. /*NP_VERSION*/”Replace with the version string defined in plugins/nitropack/constants.php. Open that file and find the NITROPACK_VERSION constant. Use its value exactly, for example:
1.19.9d. /*LOGIN_COOKIES*/
Section titled “d. /*LOGIN_COOKIES*/”Replace with the full name of the WordPress login cookie for your environment. To find it:
- Log in to the wp-admin of your Autoscale environment.
- Open your browser’s developer tools and go to Application > Cookies.
- Find the cookie whose name starts with
wordpress_logged_in_. The full name includes a hash unique to your site, for examplewordpress_logged_in_5555cc449175b4610722b990886ce0dc. - Use the full cookie name as the replacement value.
4. Commit and deploy
Section titled “4. Commit and deploy”Add both files to your repository and get them into the branch your pipeline is watching. For example:
git add plugins/nitropack advanced-cache.phpgit commit -m "Add NitroPack with advanced-cache.php drop-in"git pushYour Pipelines deployment will pick up the commit and build a new image.
5. Activate NitroPack in wp-admin
Section titled “5. Activate NitroPack in wp-admin”Once the deployment completes, go to wp-admin and activate NitroPack. Follow the standard activation flow to connect your NitroPack account and configure the plugin.
6. Go live and verify
Section titled “6. Go live and verify”In the NitroPack settings, click Go Live to disable test mode. Then check that caching is working by inspecting the response headers on your homepage:
curl -I https://your-autoscale-domain.com/Look for:
x-nitro-cache: HITA HIT value confirms that NitroPack is serving cached responses.
Deactivating NitroPack
Section titled “Deactivating NitroPack”If you deactivate the NitroPack plugin, clear the contents of advanced-cache.php in your repository and redeploy. Leaving the drop-in in place after deactivation will cause errors on every request.