Skip to content

use ETag to decrease rate limit hits #101

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2013
Merged

use ETag to decrease rate limit hits #101

merged 1 commit into from
Dec 23, 2013

Conversation

docteurklein
Copy link
Contributor

Since a certain time, github doesn't seem to use date based http cache headers.
It seems however, that they look at etags.

this PR adds etag headers in addition to existing dates headers.

@@ -43,6 +43,17 @@ public function set($id, Response $response)
if (false === @file_put_contents($this->getPath($id), serialize($response))) {
throw new \InvalidArgumentException(sprintf('Cannot put content in file "%s"', $this->getPath($id)));
}
if (false === @file_put_contents($this->getPath($id).'.etag', $response->getHeader('ETag'))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@ is evil 😜

cursedcoder added a commit that referenced this pull request Dec 23, 2013
use ETag to decrease rate limit hits
@cursedcoder cursedcoder merged commit b213498 into master Dec 23, 2013
@cursedcoder cursedcoder deleted the feature/etag branch May 25, 2015 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants