You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, in reality toggle middleware is executed before request is passed to the next middleware (See: apicache.js#L282, therefore status code will always be 200 while executing the toggle middleware in both of the endpoint listed in example. Status codes include options should be used instead for caching 200 responses only.
The toggle middleware functionality might be working as intended in which case the example is wrong or this could be a bug and the example should be working.
The text was updated successfully, but these errors were encountered:
I'll look into this @josalmi - if nothing else, this is definitely something to add to a future release (pre/post route passes for caching)... will try and see if I can work something in the existing [dated] architecture in the meantime...
The readme contains an example Middleware toggle usage here: https://github.com/kwhitley/apicache#use-with-middleware-toggle-for-fine-control
However, in reality toggle middleware is executed before request is passed to the next middleware (See: apicache.js#L282, therefore status code will always be 200 while executing the toggle middleware in both of the endpoint listed in example. Status codes include options should be used instead for caching 200 responses only.
The toggle middleware functionality might be working as intended in which case the example is wrong or this could be a bug and the example should be working.
The text was updated successfully, but these errors were encountered: