Query cache not being invalidated

Hi. We’re having some issues with content not updating on our site and it looks like it might be query caching on the GQL API.

I have a simple recreation. I created a query in the CDA Explorer:

query MyQuery($id: ItemId) {
  documentationPage(filter: {id: {eq: $id}}) {

and executed it with ‘Include draft records’ enabled. It returned the data as expected. I then updated the record in the CMS to add ‘Test’ to the title and saved it (but didn’t publish). When re-executing the query I still see the old title in the response, and the _updatedAt date hasn’t changed.

In the CMS I see the last updated time as 12:37:

Screenshot 2023-04-17 at 12.41.46

The data returned includes "_updatedAt": "2023-04-17T12:34:31+01:00" from the 1st change.

Editing the query in any way returns the correct data, which is why I suspected caching.

Response headers for the query that doesn’t work, in case they are useful:

accept-ranges: bytes
access-control-allow-credentials: true
access-control-allow-headers: authorization, content-type, x-environment, x-include-drafts, x-exclude-invalid
access-control-allow-methods: GET, POST
access-control-allow-origin: https://website-3849.admin.datocms.com
access-control-expose-headers: x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, x-entities
access-control-max-age: 1728000
age: 478
cache-control: no-store
cf-cache-status: DYNAMIC
cf-ray: 7b946a301ea60742-MAN
content-encoding: gzip
content-type: application/json; charset=utf-8
date: Mon, 17 Apr 2023 11:44:12 GMT
etag: W/"baca82154aadb2ae54502380244085e4"
expires: 0
pragma: no-cache
referrer-policy: strict-origin-when-cross-origin
server: cloudflare
strict-transport-security: max-age=15552000; includeSubDomains; preload
vary: Authorization, Accept-Encoding, X-Environment, X-Include-Drafts, X-Exclude-Invalid, Origin
via: 1.1 vegur, 1.1 varnish, 1.1 varnish
x-analysis-fields-count: 1
x-analysis-introspection: 0
x-analysis-item-types-count: 1
x-analysis-successful: 1
x-batch: 0
x-cache: MISS, HIT
x-cache-hits: 0, 4
x-cacheable-on-cdn: true
x-cacheable-on-cdn-query-length-limit: 291/8192
x-complexity: 303
x-content-type-options: nosniff
x-download-options: noopen
x-environment: main
x-frame-options: SAMEORIGIN
x-max-complexity: 10000000
x-permitted-cross-domain-policies: none
x-queue-time: 2ms
x-request-id: 5419b68c-3d3a-44d3-ba58-2af7999dd54b
x-runtime: 0.088786
x-served-by: cache-dub4322-DUB, cache-man4124-MAN
x-timer: S1681731853.840509,VS0,VE0
x-timings-execution: 0.011
x-timings-preanalysis: 0.007
x-timings-schema-generation: 0.049
x-timings-total: 0.067
x-xss-protection: 1; mode=block
1 Like

Hello @james1

We are experiencing some temporary issues with cache invalidation, sorry about that.

I’ll get back to you as soon as this is solved.


We just shipped a fix for this issue, and the cache invalidation is back to working normally.

We logged and detailed the issue in our status page, if you want any further information: https://status.datocms.com/

Sorry once again for the issues this may have caused, and thank you once again for letting us know!

1 Like

Working perfectly now, thanks. I had checked the status page before raising it but it must have been before the update was added.