Skip to content
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

Adding fail on cache-hit feature #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stjohnjohnson
Copy link
Contributor

Per the instructions on the DonorDrive API, we can send the ETag value and get a 304 if the contents have not changed.

https://github.com/DonorDrive/PublicAPI/blob/master/overview.md#status-codes

I've added the cacheTag and lastModifiedUTC to the response of getUserInfo. Additionally, an optional cacheTag that will cause a rejected promise with "Not Modified" if the cache hits.

Additionally, res.json() is a promise, so the previous code was unable to access or modify the return value. This also meanth that it would never load the teamURL. Instead of restoring the teamURL functionality, I removed it so that we don't add additional API calls without explict ask.

Per the instructions on the DonorDrive API, we can send the ETag value
and get a 304 if the contents have not changed.

https://github.com/DonorDrive/PublicAPI/blob/master/overview.md#status-codes

I've added the `cacheTag` and `lastModifiedUTC` to the response of getUserInfo.  Additionally, an optional `cacheTag` that will cause a rejected promise with "Not Modified" if the cache hits.

Additionally, `res.json()` is a promise, so the previous code was unable
to access or modify the return value.  This also meanth that it would
never load the teamURL.  Instead of restoring the teamURL functionality,
I removed it so that we don't add additional API calls without explict
ask.
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.

None yet

1 participant