I have been unable to track this down for a full day now and am out of ideas of where to look.
It seems that the Laravel 5.4 built-in throttle middleware is seeing all my individual GET requests as two requests.
Here's my API route:
Route::group(['middleware' => 'auth:api'], function () {
Route::get('inventory', ['uses' => 'InventoryController@index', 'middleware' => 'throttle:5,2'], function () {});
});
Using Postman, I issue a single GET request to the inventory route. In the cache, I see the timestamp and hit count like this:
1489436639i:2;
On a second GET request, the cache records this:
1489436639i:4;
Again, it doubles the count.
For every single GET request, it's registering as two hits. My inventory code is very simple, and there are no redirects for other calls to the server made. I've confirmed this by looking at the Apache request logs, and only one Apache access log entry is recorded for each GET request.
I'm on the latest code as of this morning (just did a composer update). I also confirmed this behaviour is happening on another server to which the code is deployed.
Any help would be greatly appreciated!