paquettg / leaguewrap

League of Legend API wrapper
MIT License
67 stars 28 forks source link

Update AbstractApi.php #70

Closed alabama closed 9 years ago

alabama commented 9 years ago

I had a problem with caching none 200 code responses, mostly with the "currentGame" request. Every Response was cached, even the 503 oder 404 ones, with the amount of seconds i specified.

The code checks if the returned content is a Response object. If it is it will check the setted code for a 200 response and only this ones will be cached. If the content is not a Resonse object it will be cached without restriction.

like @danijoo suggested, there should be a kind of flag where you can determin if a none 200 response should be valid too and should be cached as well: https://github.com/paquettg/leaguewrap/issues/69

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.09%) to 93.57% when pulling 99e97150f8b358b0103a3ad729732b108d8aa54e on alabama:patch-2 into cfc63ae1894f53c7b8901670da742cd964a23f84 on paquettg:master.