Skip to content

Comments

Adding fail on cache-hit feature#23

Open
stjohnjohnson wants to merge 1 commit intoammuench:masterfrom
stjohnjohnson:caching
Open

Adding fail on cache-hit feature#23
stjohnjohnson wants to merge 1 commit intoammuench:masterfrom
stjohnjohnson:caching

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.

1 participant