In addition to automatic cache purging, NitroPack for Magento offers commands to manually purge the cache for specific products, tags, categories, or URLs.
The feature is available for NitroPack for Magento 3.2.0 and above.
Here’s how to leverage the commands:
Purge Cache by URL
To purge the cache for specific URLs, use the "nitropack:purge:url" command.
Syntax
php bin/magento nitropack:purge:url [url1] [url2] ...
Example
To purge the cache for the URLs https://example.com/page1 and https://example.com/page2, run:
php bin/magento nitropack:purge:url https://example.com/page1 https://example.com/page2
Purge Cache by Product ID
To purge the cache for specific products using their product IDs, use the "nitropack:purge:product" command.
Syntax
php bin/magento nitropack:purge:product [productId1] [productId2] ...
Example
To purge the cache for products with IDs 101 and 202, run:
php bin/magento nitropack:purge:product 101 202
Purge Cache by Magento Cache Tag
To purge the cache based on the Magento cache tags, use the "nitropack:purge:tag" command.
Syntax
php bin/magento nitropack:purge:tag [tag1] [tag2] ...
Example
To purge the cache for items tagged with `p_123` and `cms_b_84`, run:
php bin/magento nitropack:purge:tag p_123 cms_b_84
Purge Cache by Category ID
To purge the cache for specific categories by their category IDs, use the "nitropack:purge:category" command.
Syntax
php bin/magento nitropack:purge:category [categoryId1] [categoryId2] ...
Example
To purge the cache for categories with IDs 33 and 44, run:
php bin/magento nitropack:purge:category 33 44
Purge All Cache
To purge the entire cache, use the "nitropack:purge" command.
php bin/magento nitropack:purge
Note: The location of your php executable may vary depending on your server.
Important Note
Due to how the NitroPack service works, when you purge the cache by cache tag, product ID, category ID, or URL, NitroPack will purge the cache for all pages where these elements are present. We do not perform partial cache purges for specific parts of a page.