magento2
magento2 copied to clipboard
Exclude pages of a specific pattern from Magento FPC
Description
I would like to exclude from both the Default Cache and Full Page Cache (FPC) of my Magento store a number of pages which don't have some business value. For example, pages with URLs including GET parameters such as pagination and sorting. I was told that there are directives of the file app/etc/env.php that can be specified at the section "cache" and/or "page_cache" as follows:
'exclude' => [ 'pattern' => [ 'path/to/exclude/*', 'another/path/*', . . . ] ]
However, I have not found any information about those very directives at the env.php reference below:
https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/files/config-reference-envphp
Expected behavior
The administrator is able to configure patterns of pages to be excluded from Magento FPC. For example something like: *?p= which will exclude from FPC pages like the following: https://www.example.com/my-category-12-page.html?p=4
Benefits
The FPC will not be cluttered with content that does not have business value. As a result, lower RAM will be required for REDIS. Also, I have noticed that file-based FPC solutions don't work properly when the size of the cached data exceed a threshold depending on the hardware capacity and the used FPC solution that uses files.
Additional information
No response
Release note
No response