Skip to content

Commit

Permalink
add Expires header in response
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed May 15, 2019
1 parent 3496e68 commit dcbef08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Http/Middleware/JikanResponseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ public function handle(Request $request, Closure $next)
->withHeaders([
'X-Request-Hash' => $this->fingerprint,
'X-Request-Cached' => $this->requestCached,
'X-Request-Cache-Expiry' => app('redis')->get($this->cacheExpiryFingerprint) - time()
]);
'X-Request-Cache-Ttl' => app('redis')->get($this->cacheExpiryFingerprint) - time()
])
->setExpires((new \DateTime())->setTimestamp($this->requestCacheExpiry))
;
}

private function generateMeta(Request $request) : array
Expand Down

0 comments on commit dcbef08

Please sign in to comment.