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
When requesting an endpoint, which in turn accesses an external API, the first request to the endpoint does not get cached, only the second one. The same happens after the cache entry expires. The first request after expiry does not get cached, only the second.
GET /character/95334664 [STARTED]
res statuscode:200
GET /character/95334664 [FINISHED] 172.248 ms
GET /character/95334664 [CLOSED] 173.735 ms
GET /character/95334664 [STARTED]
res statuscode:200
GET /character/95334664 [FINISHED] 137.996 ms
GET /character/95334664 [CLOSED] 138.306 ms
[apicache] adding cache entry for "get/character/95334664{}" @ 1 minute - 139ms
The text was updated successfully, but these errors were encountered:
I'll try to reproduce the behavior you are experiencing but i have the following questions:
What apicache-plus version are you using? Check with npm list apicache-plus
Are you using it with express or another framework?
Are you using redis or regular memory store? If redis, is it node-redis or io-redis and what version?
Can you show a simplified version of your route middleware config?
@webwizrd Caching happens on first response, but the debug statement is delayed a bit, because caching finishes some time after response has already been sent (caching doesn't block response, it starts together but ends a bit later).
You can see it is all working as intended when you slow down the request rate.
When requesting an endpoint, which in turn accesses an external API, the first request to the endpoint does not get cached, only the second one. The same happens after the cache entry expires. The first request after expiry does not get cached, only the second.
The text was updated successfully, but these errors were encountered: