Any way to only cache GOOD responses in data sources?

Any way to only cache GOOD responses in data sources?


0

Is there any way in @apollo/datasource-rest to cache "good" responses from my rest api, i.e statuses 200 to 299.

I read in the datasource-rest documentation (https://github.com/apollographql/datasource-rest/blob/main/src/HTTPCache.ts#L201) that "With a TTL override, only cache successful responses but otherwise ignore method and response headers" Does that mean that adding this to my dataSource:

cacheOptions: {
        ttl: 60,
      },

would be sufficient enough to only cache good responses from my api?


Load 4 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *