From 214a93008b3dbf032c80827a6eaced59e1262fc4 Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 31 Aug 2020 01:17:18 -0700 Subject: [PATCH] don't cache poses for Support tool I noticed in prod that the Vercel edge cache can show old data in the Support tool right after you edit it and reload the page, which is super confusing! In this change, we stop caching the endpoint we use for Support tools, so that the Support tools always feel real-time and trustworthy. (The standard pose picker might still be cached, so it could be a bit confusing for that to be out of sync, but at least you can toggle into Support mode and see that your changes happened _there_, so you don't panic that they're _gone_.) --- src/server/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index a86b8c8..7d75785 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -224,9 +224,11 @@ const typeDefs = gql` @cacheControl(maxAge: 10800) # Cache for 3 hours (we might model more!) # All pet appearances we've ever seen for the given species and color. Note # that this might include multiple copies for the same pose, and they might - # even be glitched data. We use this for Support tools. + # even be glitched data. We use this for Support tools, and we don't cache + # it to make sure that Support users are always seeing the most up-to-date + # version here (even if the standard pose picker is still showing outdated + # cached canonical poses). petAppearances(speciesId: ID!, colorId: ID!): [PetAppearance!]! - @cacheControl(maxAge: 10800) # Cache for 3 hours (we might model more!) outfit(id: ID!): Outfit petOnNeopetsDotCom(petName: String!): Outfit