Odyssey Part 2 - Caching of RESTDataSource does not work for authors due to 'no-cache' control header

Hello,

you mentioned in your course that the response for the subsequent calls to the author might be cached.
But they wouldn’t be cached due to the repsonse header send by the server.

Cache-Control: no-store

curl -I -X 'GET' \
  'https://odyssey-lift-off-rest-api.herokuapp.com/author/cat-9' \
  -H 'accept: application/json'
HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Cache-Control: no-store
Content-Type: application/json; charset=utf-8
Content-Length: 206
Etag: W/"ce-pG2IWf1U8RdBk4zXHBrMtJrHkvg"
Date: Sun, 02 Jan 2022 17:00:27 GMT
Via: 1.1 vegur

If you request the tracks everything works as expected.

Cache-Control: public, max-age=600

curl -I -X 'GET' \
  'https://odyssey-lift-off-rest-api.herokuapp.com/tracks' \
  -H 'accept: application/json'
HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Cache-Control: public, max-age=600
Content-Type: application/json; charset=utf-8
Content-Length: 33797
Etag: W/"8405-g3PnHpoggiDJWw2WxSMeMpL+CSo"
Date: Sun, 02 Jan 2022 16:59:38 GMT
Via: 1.1 vegur

best regrads,
Mathias

Hey Mathias!

Apologies for the long wait on this reply! We’ll revisit the REST API for Catstronauts as soon as we get the chance and double-check those cache-control values. Let us know if there’s a specific lesson or paragraph you’re referring to for this situation and we’ll take a look as well! Thanks for bringing it up!

Hi Michelle
I bumped into the same issue,
It’s lesson 8 of part 2

Not a big deal, but a bit confusing.
But the course itself is top-notch - I’m already falling in love with GraphQL and Apollo. Thanks a lot, guys!

1 Like

I have the same issue, because the /tracks endpoint is cached, but /author/{id} isn’t, the data source doesn’t speed up the request that much at all, it’s around 500ms every time.

Hi all @emmiep @fremdev and @MaLu !

Thanks so much for your patience and for bringing this up! We’ve resolved the issue on our end, you can see more details in @Raph’s post here.

Let us know if you continue to run into any issues!