Closed jamesvillarrubia closed 5 years ago
Setup cache on a nested route with a version number ahead of the service. Example: example.com/v1/resources/1?test=true
To clear the cache, I'm running GET cache/clear/single/v1/resources/1?test=true
Cache key should be 'v1/resources/1?test=true'
Error. Cannot find path.
router.get('/clear/single/:target', (req, res) => { let target = decodeURIComponent(req.params.target);
becomes
router.get('/clear/single/*', (req, res) => { let target = decodeURIComponent(req.params[0]);
If this sounds like a useful tweak, I'm happy to submit a PR.
Thank you!
Steps to reproduce
Setup cache on a nested route with a version number ahead of the service. Example: example.com/v1/resources/1?test=true
To clear the cache, I'm running GET cache/clear/single/v1/resources/1?test=true
Expected behavior
Cache key should be 'v1/resources/1?test=true'
Actual behavior
Error. Cannot find path.
Proposed Solution (What worked for me)
becomes
If this sounds like a useful tweak, I'm happy to submit a PR.