Cloudflare Caching Issues with non-existing resources

Hi there,

we have a very strange issue with Cloudflare Caching. We are using Angular Apollo but we can reproduce it in Insomnia (or Postman) as well.

Steps for reproduction:

  • Query a resource that not exists: get an empty response back
  • Create the resource
  • Query the resource again and you will get the empty response back again

This does not happen if you update an resource. In this case the cache is invalidated and you will get the updated resource back.

Observations:
We can get the content if we change something on the GraphQl Query and therefore Cloudflare does issue an new X-Request-Id. But as long the X-Request-Id stays the same there is no way to get content.

Do you handle caching of not existing resources differently?

Cheers,
Markus

Hi @magbeat! Yes we should handle caching of non existing resources correctly :smiley:
Could you share the exact query? There might be a bug somewhere!

Hi @s.verna,

We had the issue with this query (with much more fields of course). But the number of fields had no influence.

{
  allPages(locale: en, filter: {division: {eq: 455834}, areaNew: {eq: 1233373}, identifier: {eq: "structure"}}) {
     identifier
     __typename
  }
} 

The page is already there in German. When we query the page in English (before creating the locales) the API responded with an empty array. Even after we have created the English locale.

Ok, great, we’ll try to investigate and we’ll let you know the results!

Thanks a lot!

Hey @magbeat! You were right! There was an edge condition where we didn’t invalidate the cache’s surrogate keys! Should be solved now!

Hey @s.verna. Thanks for the update and the fix! Cheers, Markus