Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added header to allow dynamic ttl per request when using greedy cache #100

Merged
merged 3 commits into from
Nov 21, 2017

Conversation

Neirda24
Copy link
Contributor

Fix #98

if ($request->hasHeader(self::HEADER_TTL)) {
$ttlHeaderValues = $request->getHeader(self::HEADER_TTL);
$ttl = (int)reset($ttlHeaderValues);
unset($ttlHeaderValues);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you do this unset?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was just to not keep a variable that has no purposes. I would prefer to not create it but reset takes only variables. Do you prefer I remove this line @Kevinrob ?

@Kevinrob
Copy link
Owner

Thanks for the PR!
Can you add some tests about this feature? If you don't have time, I can do it myself.

@Neirda24
Copy link
Contributor Author

@Kevinrob : I'll try to add some tests. I'll let you know ;)

@Neirda24
Copy link
Contributor Author

@Kevinrob : In fact I don't see how to write this tests as no other tests are ttl oriented.

@Kevinrob
Copy link
Owner

Okay, I will check for adding tests!

@Kevinrob Kevinrob merged commit e34f76f into Kevinrob:master Nov 21, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants