While testing the Souin caching mechanism, we've encountered an issue where cache invalidation does not work correctly when using filtered GetCollection requests with fields[] parameters. Specifically:
GetCollection requests work correctly.
GetID requests also work correctly.
However, GetCollection requests with fields[] filters trigger invalidation but not deleted in souin.
Example: GET http://localhost:81/customers/1
Result: Works correctly and cache invalidation occurs as expected.
Perform a GetCollection request with filters:
Cache invalidation should occur for all GetCollection requests, including those with fields[] parameters, just as it does for other filtered and unfiltered requests.
Repository https://github.com/g-ra/ISSUE-944-apiplatform/tree/issue-2 Video Demonstration: https://www.loom.com/share/b512959e7a944f6b8bf3bacdf20ac32d
Description:
While testing the Souin caching mechanism, we've encountered an issue where cache invalidation does not work correctly when using filtered GetCollection requests with fields[] parameters. Specifically:
GetCollection requests work correctly. GetID requests also work correctly. However, GetCollection requests with fields[] filters trigger invalidation but not deleted in souin.
mode bypass
Steps to Reproduce:
Perform a GetCollection request:
Example: GET http://localhost:81/customers?page=1 Result: Works correctly and cache invalidation occurs as expected. Perform a GetID request:
Example: GET http://localhost:81/customers/1 Result: Works correctly and cache invalidation occurs as expected. Perform a GetCollection request with filters:
Example: GET http://localhost:81/customers?page=1&fields[]=name Result: Cache invalidation does not occur as expected. Compare with a GetCollection request using query parameters:
Example: GET http://localhost:81/customers?page=1&firstname=John Result: Works correctly and cache invalidation occurs as expected.
Expected Behavior:
Cache invalidation should occur for all GetCollection requests, including those with fields[] parameters, just as it does for other filtered and unfiltered requests.