strapi-community / strapi-plugin-rest-cache

Speed-up HTTP requests with LRU cache.
https://strapi-community.github.io/strapi-plugin-rest-cache/
MIT License
129 stars 29 forks source link

fix: remove trailing slashes from cache keys #51

Closed molund closed 1 year ago

molund commented 1 year ago

Fix for https://github.com/strapi-community/strapi-plugin-rest-cache/issues/45.

This change removes trailing slashes from cache keys.

Requested url is used as key for the cache. But the same request with and without a trailing slash lead to 2 separate cache entries.

This also caused issues with purging and clearByUid (only the entry without the trailing slash was removed).

derrickmehaffy commented 1 year ago

Thanks for the PR, I'm currently doing a bunch of cleanup and did some tweaking (and was unable to push to your fork). So I've merged your changes into: https://github.com/strapi-community/strapi-plugin-rest-cache/pull/61