darkweak / souin

An HTTP cache system, RFC compliant, compatible with @tyktechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @go-kratos, @gin-gonic, @roadrunner-server, @zalando, @zeromicro, @nginx and @apache
https://docs.souin.io
MIT License
719 stars 56 forks source link

[BUG] Invalidation Does Not Work with Filtered GetCollection Requests Using fields[] Apiplatform #544

Closed g-ra closed 3 months ago

g-ra commented 3 months ago

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.

darkweak commented 3 months ago

Resolved by #545