Closed edeuss closed 7 months ago
Doesn't seem to be related to the &
symbol but that the package is for some reason flipping the query parameter locations so it comes up as a different cache key.
Turns out to be an issue with Dio on onResponse returning the query parameter's out of order.
Going to open up an issue with Dio, but for a temp fix, if anyone else is having the same issue you can do:
keyBuilder: (RequestOptions request) {
Map<String, List<String>> queryParams =
request.uri.queryParametersAll;
// Sort the query parameters alphabetically
var sortedParams =
SplayTreeMap<String, List<String>>.from(queryParams);
// Reconstruct the URI with sorted query parameters
Uri sortedUri = request.uri.replace(queryParameters: sortedParams);
return sortedUri.toString();
},
I have been trying to figure out why some endpoints are caching and why some are not. It seems to me like endpoints it's not caching have more than one query parameter and the ones with one cache correctly. Maybe the
&
symbol is messing something up since they have the same caching rules.Package versions used:
Cache options: