Don't HTTP cache currentUserOwnsThis/wants
Hmm, I see, Vercel chews on Cache-Control headers a bit more than I'm used to, so anything marked `scope: PRIVATE` would not be cached at all. But on a more standard server, this was coming out as privately cacheable, but for an actual amount of time (1 hour in the homepage case), because of the `maxAge` on other fields. That meant the device browser cache would hold onto the result, and not always reflect Own/Want changes upon page reload. In this change, we set `maxAge: 0`, because we want this field to be very responsive. I also left `scope: PRIVATE`, even though I think it doesn't really matter if we're saying the field isn't cacheable anyway, because I want to set the precendent that `currentUser` fields need it, to avoid a potential gotcha if someone creates a cacheable `currentUser` field in the future. (That's important to be careful with though, because is it even okay for logouts to not clear it? TODO: Can we clear the private HTTP cache somehow? I guess we would need to include the current user ID in the URL?)
This commit is contained in:
parent
a67509aaec
commit
002af474f8
1 changed files with 2 additions and 2 deletions
|
@ -33,8 +33,8 @@ const typeDefs = gql`
|
||||||
"""
|
"""
|
||||||
wakaValueText: String @cacheControl(maxAge: ${oneHour})
|
wakaValueText: String @cacheControl(maxAge: ${oneHour})
|
||||||
|
|
||||||
currentUserOwnsThis: Boolean! @cacheControl(scope: PRIVATE)
|
currentUserOwnsThis: Boolean! @cacheControl(maxAge: 0, scope: PRIVATE)
|
||||||
currentUserWantsThis: Boolean! @cacheControl(scope: PRIVATE)
|
currentUserWantsThis: Boolean! @cacheControl(maxAge: 0, scope: PRIVATE)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
How many users are offering/seeking this in their public trade lists.
|
How many users are offering/seeking this in their public trade lists.
|
||||||
|
|
Loading…
Reference in a new issue